6

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've tried disabling some apache and php modules but I'm still getting the same error.

I've also tried putting this in apache2.conf:

CoreDumpDirectory /tmp/apache2-gdb-dump

and then chmod 777, chown www-data... so that the server can write.

I can see no core-dump files to give me a hint on the error.

Does anybody have an idea why CoreDumpDirectory isn't working on Ubuntu?

answers: $ ulimit -a core file size
(blocks, -c) unlimited data seg size
(kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 15863 max locked memory
(kbytes, -l) 32 max memory size
(kbytes, -m) unlimited open files
(-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues
(bytes, -q) 819200 real-time priority (-r) 0 stack size
(kbytes, -s) 8192 cpu time
(seconds, -t) unlimited max user processes (-u) 15863 virtual memory (kbytes, -v) unlimited file locks
(-x) unlimited

3 Answers 3

11

I finally was able to see Apache's core dump in Ubuntu:

  1. edit /etc/default/apport
  2. edit apache2.conf:

      CoreDumpDirectory /tmp/apache2-gdb-dump
    
  3. make sure Apache can write to it:

    # chmod 777 /tmp/apache2-gdb-dump
    
  4. remove core dump size limit:

    # ulimit -c unlimited
    
  5. 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

3
  • You need to sudo mkdir /tmp/apache2-gdb-dump before you chmod/chown it. Aug 15, 2011 at 18:33
  • 6
    What did you change in /etc/default/apport? Sep 13, 2012 at 16:03
  • 3
    "gzb": do you mean gdb?
    – pevik
    Nov 13, 2013 at 15:27
2

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)

1
  • it doesn't seem to do anything >$ ulimit -c unlimited >$ //nothing happens >$ sudo ulimit -c unlimited >sudo: ulimit: command not found >$ man ulimit No manual entry for ulimit > sudo aptitude search ulimit p cpulimit - limits the cpu usage of a process (??)
    – arod
    Mar 29, 2010 at 2:10
1

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

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.