php exec('mu extract testmail.eml') gives Segmentation fault in Browser but not on the command line as user www-data.

Asked by Clemens Tewinkel

Hello,

I reproduced this error with a fresh setup of Ubuntu 12.04 Server 64 Bit. The problem does not occur in 11.10.
I chose openssh and LAMP during install.
After Install I only executed:

sudo apt-get upgrade
sudo apt-get install maildir-utils
sudo mkdir /var/www/.mu
sudo chown www-data:www-data /var/www/.mu

Then I created /var/www/test.php with

<html>
  <?php
    $ret = array();
    exec('mu extract /home/clemens/unsigned.eml', $ret, $ret_val);
    print_r($ret);
    echo "$ret_val\n";
  ?>
</html>

In my Browser I get:

<html>
Array
(
    [0] => MIME-parts in this message:
    [1] => 0
)
139
</html>

I tried:

sudo su -
su www-data
mu extract /home/clemens/unsigned.eml

and it worked fine:

$ mu extract /home/clemens/unsigned.eml
MIME-parts in this message:
  0 <none> text/plain [<none>] (1.7 kB)
  1 Antrag.pdf application/octet-stream [attachment] (62.0 kB)

A very big THANK YOU for any help in advance!
I append the core dump found in /var/crash:

root@ubuntu:/var/crash# cat _usr_bin_mu.33.crash
ProblemType: Crash
Architecture: amd64
Date: Fri Jul 6 09:24:26 2012
DistroRelease: Ubuntu 12.04
ExecutablePath: /usr/bin/mu
ExecutableTimestamp: 1335207005
ProcCmdline: mu extract /home/clemens/unsigned.eml
ProcCwd: /var/www
ProcEnviron:
 PATH=(custom, no user)
 LANG=C
ProcMaps:
 00400000-00432000 r-xp 00000000 08:01 792425 /usr/bin/mu
 00631000-00632000 r--p 00031000 08:01 792425 /usr/bin/mu
 00632000-00633000 rw-p 00032000 08:01 792425 /usr/bin/mu
 00633000-00637000 rw-p 00000000 00:00 0
 016d2000-01717000 rw-p 00000000 00:00 0 [heap]
 7f2886a73000-7f2886a7f000 r-xp 00000000 08:01 393253 /lib/x86_64-linux-gnu/libnss_files-2.15.so
 7f2886a7f000-7f2886c7e000 ---p 0000c000 08:01 393253 /lib/x86_64-linux-gnu/libnss_files-2.15.so
 7f2886c7e000-7f2886c7f000 r--p 0000b000 08:01 393253 /lib/x86_64-linux-gnu/libnss_files-2.15.so
 7f2886c7f000-7f2886c80000 rw-p 0000c000 08:01 393253 /lib/x86_64-linux-gnu/libnss_files-2.15.so
 7f2886c80000-7f2886c8a000 r-xp 00000000 08:01 393254 /lib/x86_64-linux-gnu/libnss_nis-2.15.so
 7f2886c8a000-7f2886e8a000 ---p 0000a000 08:01 393254 /lib/x86_64-linux-gnu/libnss_nis-2.15.so
 7f2886e8a000-7f2886e8b000 r--p 0000a000 08:01 393254 /lib/x86_64-linux-gnu/libnss_nis-2.15.so
 7f2886e8b000-7f2886e8c000 rw-p 0000b000 08:01 393254 /lib/x86_64-linux-gnu/libnss_nis-2.15.so
 7f2886e8c000-7f2886ea3000 r-xp 00000000 08:01 393248 /lib/x86_64-linux-gnu/libnsl-2.15.so
 7f2886ea3000-7f28870a2000 ---p 00017000 08:01 393248 /lib/x86_64-linux-gnu/libnsl-2.15.so
 7f28870a2000-7f28870a3000 r--p 00016000 08:01 393248 /lib/x86_64-linux-gnu/libnsl-2.15.so
 7f28870a3000-7f28870a4000 rw-p 00017000 08:01 393248 /lib/x86_64-linux-gnu/libnsl-2.15.so
 7f28870a4000-7f28870a6000 rw-p 00000000 00:00 0
 7f28870a6000-7f28870ae000 r-xp 00000000 08:01 393256 /lib/x86_64-linux-gnu/libnss_compat-2.15.so
 7f28870ae000-7f28872ad000 ---p 00008000 08:01 393256 /lib/x86_64-linux-gnu/libnss_compat-2.15.so
 7f28872ad000-7f28872ae000 r--p 00007000 08:01 393256 /lib/x86_64-linux-gnu/libnss_compat-2.15.so
 7f28872ae000-7f28872af000 rw-p 00008000 08:01 393256 /lib/x86_64-linux-gnu/libnss_compat-2.15.so
 7f28872af000-7f28872b1000 r-xp 00000000 08:01 393260 /lib/x86_64-linux-gnu/libdl-2.15.so
 7f28872b1000-7f28874b1000 ---p 00002000 08:01 393260 /lib/x86_64-linux-gnu/libdl-2.15.so
 7f28874b1000-7f28874b2000 r--p 00002000 08:01 393260 /lib/x86_64-linux-gnu/libdl-2.15.so
 7f28874b2000-7f28874b3000 rw-p 00003000 08:01 393260 /lib/x86_64-linux-gnu/libdl-2.15.so
 7f28874b3000-7f28874cb000 r-xp 00000000 08:01 393247 /lib/x86_64-linux-gnu/libresolv-2.15.so
 7f28874cb000-7f28876cb000 ---p 00018000 08:01 393247 /lib/x86_64-linux-gnu/libresolv-2.15.so
 7f28876cb000-7f28876cc000 r--p 00018000 08:01 393247 /lib/x86_64-linux-gnu/libresolv-2.15.so
 7f28876cc000-7f28876cd000 rw-p 00019000 08:01 393247 /lib/x86_64-linux-gnu/libresolv-2.15.so
 7f28876cd000-7f28876cf000 rw-p 00000000 00:00 0
 7f28876cf000-7f28876ec000 r-xp 00000000 08:01 393309 /lib/x86_64-linux-gnu/libselinux.so.1
 7f28876ec000-7f28878eb000 ---p 0001d000 08:01 393309 /lib/x86_64-linux-gnu/libselinux.so.1
 7f28878eb000-7f28878ec000 r--p 0001c000 08:01 393309 /lib/x86_64-linux-gnu/libselinux.so.1
 7f28878ec000-7f28878ed000 rw-p 0001d000 08:01 393309 /lib/x86_64-linux-gnu/libselinux.so.1
 7f28878ed000-7f28878ee000 rw-p 00000000 00:00 0
 7f28878ee000-7f28878f1000 r-xp 00000000 08:01 791227 /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.3200.3
 7f28878f1000-7f2887af0000 ---p 00003000 08:01 791227 /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.3200.3
 7f2887af0000-7f2887af1000 r--p 00002000 08:01 791227 /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.3200.3
 7f2887af1000-7f2887af2000 rw-p 00003000 08:01 791227 /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.3200.3
 7f2887af2000-7f2887af9000 r-xp 00000000 08:01 393250 /lib/x86_64-linux-gnu/librt-2.15.so
 7f2887af9000-7f2887cf8000 ---p 00007000 08:01 393250 /lib/x86_64-linux-gnu/librt-2.15.so
 7f2887cf8000-7f2887cf9000 r--p 00006000 08:01 393250 /lib/x86_64-linux-gnu/librt-2.15.so
 7f2887cf9000-7f2887cfa000 rw-p 00007000 08:01 393250 /lib/x86_64-linux-gnu/librt-2.15.so
 7f2887cfa000-7f2887d36000 r-xp 00000000 08:01 393338 /lib/x86_64-linux-gnu/libpcre.so.3.12.1
 7f2887d36000-7f2887f35000 ---p 0003c000 08:01 393338 /lib/x86_64-linux-gnu/libpcre.so.3.12.1
 7f2887f35000-7f2887f36000 r--p 0003b000 08:01 393338 /lib/x86_64-linux-gnu/libpcre.so.3.12.1
 7f2887f36000-7f2887f37000 rw-p 0003c000 08:01 393338 /lib/x86_64-linux-gnu/libpcre.so.3.12.1
 7f2887f37000-7f2887f3e000 r-xp 00000000 08:01 787877 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
 7f2887f3e000-7f288813d000 ---p 00007000 08:01 787877 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
 7f288813d000-7f288813e000 r--p 00006000 08:01 787877 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
 7f288813e000-7f288813f000 rw-p 00007000 08:01 787877 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
 7f288813f000-7f2888287000 r-xp 00000000 08:01 791233 /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.3
 7f2888287000-7f2888486000 ---p 00148000 08:01 791233 /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.3
 7f2888486000-7f288848a000 r--p 00147000 08:01 791233 /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.3
 7f288848a000-7f288848c000 rw-p 0014b000 08:01 791233 /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.3
 7f288848c000-7f288848e000 rw-p 00000000 00:00 0
 7f288848e000-7f2888492000 r-xp 00000000 08:01 393506 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
 7f2888492000-7f2888691000 ---p 00004000 08:01 393506 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
 7f2888691000-7f2888692000 r--p 00003000 08:01 393506 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
 7f2888692000-7f2888693000 rw-p 00004000 08:01 393506 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
 7f2888693000-7f28886a9000 r-xp 00000000 08:01 393542 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
 7f28886a9000-7f28888a8000 ---p 00016000 08:01 393542 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
 7f28888a8000-7f28888a9000 r--p 00015000 08:01 393542 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
 7f28888a9000-7f28888aa000 rw-p 00016000 08:01 393542 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
 7f28888aa000-7f28888c2000 r-xp 00000000 08:01 393279 /lib/x86_64-linux-gnu/libpthread-2.15.so
 7f28888c2000-7f2888ac1000 ---p 00018000 08:01 393279 /lib/x86_64-linux-gnu/libpthread-2.15.so
 7f2888ac1000-7f2888ac2000 r--p 00017000 08:01 393279 /lib/x86_64-linux-gnu/libpthread-2.15.so
 7f2888ac2000-7f2888ac3000 rw-p 00018000 08:01 393279 /lib/x86_64-linux-gnu/libpthread-2.15.so
 7f2888ac3000-7f2888ac7000 rw-p 00000000 00:00 0
 7f2888ac7000-7f2888c7a000 r-xp 00000000 08:01 393244 /lib/x86_64-linux-gnu/libc-2.15.so
 7f2888c7a000-7f2888e79000 ---p 001b3000 08:01 393244 /lib/x86_64-linux-gnu/libc-2.15.so
 7f2888e79000-7f2888e7d000 r--p 001b2000 08:01 393244 /lib/x86_64-linux-gnu/libc-2.15.so
 7f2888e7d000-7f2888e7f000 rw-p 001b6000 08:01 393244 /lib/x86_64-linux-gnu/libc-2.15.so
 7f2888e7f000-7f2888e84000 rw-p 00000000 00:00 0
 7f2888e84000-7f2888e99000 r-xp 00000000 08:01 393231 /lib/x86_64-linux-gnu/libgcc_s.so.1
 7f2888e99000-7f2889098000 ---p 00015000 08:01 393231 /lib/x86_64-linux-gnu/libgcc_s.so.1
 7f2889098000-7f2889099000 r--p 00014000 08:01 393231 /lib/x86_64-linux-gnu/libgcc_s.so.1
 7f2889099000-7f288909a000 rw-p 00015000 08:01 393231 /lib/x86_64-linux-gnu/libgcc_s.so.1
 7f288909a000-7f2889193000 r-xp 00000000 08:01 393243 /lib/x86_64-linux-gnu/libm-2.15.so
 7f2889193000-7f2889392000 ---p 000f9000 08:01 393243 /lib/x86_64-linux-gnu/libm-2.15.so
 7f2889392000-7f2889393000 r--p 000f8000 08:01 393243 /lib/x86_64-linux-gnu/libm-2.15.so
 7f2889393000-7f2889394000 rw-p 000f9000 08:01 393243 /lib/x86_64-linux-gnu/libm-2.15.so
 7f2889394000-7f2889476000 r-xp 00000000 08:01 791918 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
 7f2889476000-7f2889675000 ---p 000e2000 08:01 791918 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
 7f2889675000-7f288967d000 r--p 000e1000 08:01 791918 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
 7f288967d000-7f288967f000 rw-p 000e9000 08:01 791918 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
 7f288967f000-7f2889694000 rw-p 00000000 00:00 0
 7f2889694000-7f2889786000 r-xp 00000000 08:01 393496 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3
 7f2889786000-7f2889986000 ---p 000f2000 08:01 393496 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3
 7f2889986000-7f2889987000 r--p 000f2000 08:01 393496 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3
 7f2889987000-7f2889988000 rw-p 000f3000 08:01 393496 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3
 7f2889988000-7f2889989000 rw-p 00000000 00:00 0
 7f2889989000-7f28899d6000 r-xp 00000000 08:01 791234 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3200.3
 7f28899d6000-7f2889bd6000 ---p 0004d000 08:01 791234 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3200.3
 7f2889bd6000-7f2889bd7000 r--p 0004d000 08:01 791234 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3200.3
 7f2889bd7000-7f2889bd8000 rw-p 0004e000 08:01 791234 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3200.3
 7f2889bd8000-7f2889c2d000 r-xp 00000000 08:01 791322 /usr/lib/libgmime-2.6.so.0.600.7
 7f2889c2d000-7f2889e2d000 ---p 00055000 08:01 791322 /usr/lib/libgmime-2.6.so.0.600.7
 7f2889e2d000-7f2889e31000 r--p 00055000 08:01 791322 /usr/lib/libgmime-2.6.so.0.600.7
 7f2889e31000-7f2889e42000 rw-p 00059000 08:01 791322 /usr/lib/libgmime-2.6.so.0.600.7
 7f2889e42000-7f2889e43000 rw-p 00000000 00:00 0
 7f2889e43000-7f288a02b000 r-xp 00000000 08:01 799602 /usr/lib/libxapian.so.22.4.2
 7f288a02b000-7f288a22a000 ---p 001e8000 08:01 799602 /usr/lib/libxapian.so.22.4.2
 7f288a22a000-7f288a232000 r--p 001e7000 08:01 799602 /usr/lib/libxapian.so.22.4.2
 7f288a232000-7f288a233000 rw-p 001ef000 08:01 799602 /usr/lib/libxapian.so.22.4.2
 7f288a233000-7f288a255000 r-xp 00000000 08:01 393246 /lib/x86_64-linux-gnu/ld-2.15.so
 7f288a43d000-7f288a444000 r--s 00000000 08:01 789272 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
 7f288a444000-7f288a44f000 rw-p 00000000 00:00 0
 7f288a451000-7f288a455000 rw-p 00000000 00:00 0
 7f288a455000-7f288a456000 r--p 00022000 08:01 393246 /lib/x86_64-linux-gnu/ld-2.15.so
 7f288a456000-7f288a458000 rw-p 00023000 08:01 393246 /lib/x86_64-linux-gnu/ld-2.15.so
 7fff4b23b000-7fff4b25c000 rw-p 00000000 00:00 0 [stack]
 7fff4b32f000-7fff4b330000 r-xp 00000000 00:00 0 [vdso]
 ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
ProcStatus:
 Name: mu
 State: S (sleeping)
 Tgid: 1653
 Pid: 1653
 PPid: 1652
 TracerPid: 0
 Uid: 33 33 33 33
 Gid: 33 33 33 33
 FDSize: 64
 Groups: 33
 VmPeak: 57964 kB
 VmSize: 57964 kB
 VmLck: 0 kB
 VmPin: 0 kB
 VmHWM: 3316 kB
 VmRSS: 3316 kB
 VmData: 512 kB
 VmStk: 136 kB
 VmExe: 200 kB
 VmLib: 9680 kB
 VmPTE: 132 kB
 VmSwap: 0 kB
 Threads: 1
 SigQ: 0/7827
 SigPnd: 0000000000000000
 ShdPnd: 0000000000000000
 SigBlk: 0000000000000000
 SigIgn: 0000000000001000
 SigCgt: 0000000180000000
 CapInh: 0000000000000000
 CapPrm: 0000000000000000
 CapEff: 0000000000000000
 CapBnd: ffffffffffffffff
 Cpus_allowed: 1
 Cpus_allowed_list: 0
 Mems_allowed: 00000000,00000001
 Mems_allowed_list: 0
 voluntary_ctxt_switches: 2
 nonvoluntary_ctxt_switches: 3
Signal: 11
Uname: Linux 3.2.0-23-generic x86_64
UserGroups:
CoreDump: base64
 H4sICAAAAAAC/0NvcmVEdW1wAA==
 7H0JYBvF1f/KjpxgYhBtCinkAxEgBIztlXwDAcn3bfk+... ... ....

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu php5 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sasa Paporovic (melchiaros) said :
#1

Hello Ronno,

thank you for bringing this up, but you have entered unfortunally the wrong section. This here is the question section for presenting questions from community to community people for answering. All on good will.

What you need is bugreporting.

For short:

1Press ALT and F2
2type in the software name(exactly)
3See apport starting
4Please describe your problem in a exact way, that makes it a developer which is not familiar with the softeware you use to reproduce the bug(thing of explanation to a beginner - step by step).

Please do this procedure for every software separated. One error one bugreport.

For the long story how to report a bug(recommend to read):

https://help.ubuntu.com/community/ReportingBugs

After this please close this here as solved or when you thing it makes sense than link this here with the option on this side to the bugreport.

Thank you in advance

melchiaros

Can you help with this problem?

Provide an answer of your own, or ask Clemens Tewinkel for more information if necessary.

To post a message you must log in.