I\'m trying to solve a segmentation fault. This message appears in my apache-error.log:
[notice] child pid 3979 exit signal Segmentation fault (11)
I finally was able to see Apache's core dump in Ubuntu:
/etc/default/apport
edit apache2.conf:
CoreDumpDirectory /tmp/apache2-gdb-dump
make sure Apache can write to it:
# chmod 777 /tmp/apache2-gdb-dump
remove core dump size limit:
# ulimit -c unlimited
Optionally, change the name pattern of the core dumps:
# echo 'coredump-%e.%p' > /proc/sys/kernel/core_pattern
To analyse the dump use gdb
:
$ gdb apache2 /tmp/apache2-gdb-dump/coredump-x.x
To see stacktrace details, in gdb:
gdb> where
This I did, and I obtained the core-dump. However, my problem was not solved by looking at the coredump; it was apparently an issue in my php script.
More info: http://matrafox.info/apache-child-pid-exit-signal-segmentation-fault.html
Core dumps are disabled on Ubuntu by default
Try this:
ulimit -c unlimited
"ulimit -a" tells you what the current limit is (0 means disabled)
Do note that the subdirectory in /tmp will be removed after reboot, causing apache to not start due to configuration errors.
On a second note, the chowning is unnecessary. /tmp is chmodded 777 so anyone can read/write there.
@arod sudo ulimit -c does not work because -c is also an argument of sudo. You need to sudo -s, then ulimit -c