capachedebuggingapache2-module

How to Debug an Apache Module


I've been writing an Apache module recently. It's been interesting to work with the memory pool paradigm, but I'm clearly not doing something right. I've got a segfault, and I cannot seem to find it. My current debug cycle involves ap_rprintfs and a make script that rebuilds and reloads Apache.

What kind of tools are available for working in this type of environment?


Solution

  • You should use GNU Debugger (gdb). Start Apache via command gdb bin/httpd and than r -X inside gdb. When segfault occurs, you will be able to see where it occurred with command bt.