8

I am having problems with my 14.10 Ubuntu Server. Upon performing certain actions my apache2 restarts with a segmentation fault error. In order to debug this issue I would like to create a core dump. I have done the following:

  • added CoreDumpDirectory /tmp/apache-coredumps to the config file
  • Run ulimit -c unlimited
  • Run apt-get install apache2-dbg php5-dbg
  • restarted apache and caused the error. The log claims there may be a core dump in the directory, however it is empty.

I also tried to use gdb directly on the executable of apache2, but apache won't start unless started through apachectl or service apache2 start.

How can I get a core dump to debug my issue OR how can I attach gdb directly to apache?

1 Answers1

4

ulimit -c unlimited only effects your current shell.

You can confirm this by looking at output cat /proc/$(pidof -s apache2).

I added ulimit -c unlimited to /etc/default/apache2 and now cat /proc/$(pidof -s apache2)/limits includes

Max core file size        unlimited            unlimited            bytes