What's the best way to get meaningful gdb backtraces from Apache server which misbehaves on production?

 [Tue Aug 02 16:07:12 2011] [notice] child pid 27681 exit signal Segmentation fault (11)

It's probably some Apache module doing bad things, but I need symbolic gdb traceback to get started debugging what and where.

  • How to enable debug symbols for Apache on Ubuntu

  • How to extract one and only one core dump from Apache child

  • How to reopen this file in gdb

Ubuntu 8.04 / Linux.

link|improve this question

75% accept rate
feedback

1 Answer

up vote 1 down vote accepted

See configure an Apache web server for core dump on segmentation faults.

You might also have to set core dump size limit to unlimited in /etc/security/limits.conf:

*    hard    core    unlimited

Log in, check that core size is not limited by saying ulimit -a and restart apache.

To analyze the core file, start gdb:

gdb /usr/lib/apache2/mpm-worker/apache2 /path/to/core.dump

gdb command bt prints out the stack trace.

link|improve this answer
I also had add line * soft core unlimited – Mikko Ohtamaa Aug 3 '11 at 10:00
Also for Ubuntu the gdb command was: gdb /usr/sbin/apache2 /tmp/apache2-gdb-dump/core – Mikko Ohtamaa Aug 3 '11 at 10:04
feedback

Your Answer

 
or
required, but never shown

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