Add to Favourites Add to Favourites    Print this Article Print this Article

Debugging an apache segfault

Debugging Apache segfaults can be tricky, in an attempt to find out which module may be causing it.
You might see something like this in the /var/log/httpd/error_log:

[Mon Aug 07 23:56:18.309463 2017] [core:notice] [pid 17630] AH00052: child pid 18187 exit signal Aborted (6)

  1. You can debug it using the gdb option, like this:

    service httpd stop
    gdb /usr/sbin/httpd

    and quickly (before the dataskq starts it up again), run:

    run -X -d /etc/httpd

    which should let you trigger one request in the foreground, so do it quickly, before any other connections arrive to your server.
  2. Hopefully this has triggered your segfault, in which case it might show:

    Thread 1 "httpd" received signal SIGABRT, Aborted.

    along with other info about exactly where it crashed.
  3. To see more details about the function tree used to get to that point, call a backtrace like this:

    bt full

    which should give you the list of functions called, where it started lower down, and ended at the top of the output.   Somewhere in there might show you which module triggered it.
  4. To quit gdb, just run:

    quit


Was this answer helpful?

Also Read