Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 697
Willi Ballenthin Avatar asked Dec 08 '25 10:12

Willi Ballenthin


1 Answers

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.

like image 150
Marko Kevac Avatar answered Dec 10 '25 04:12

Marko Kevac



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!