I'm attempting to inspect memory of an httpd binary compiled statically with openssl. When I list the httpd processes, I get:
$ ps aux|grep httpd
root 58539 0.0 0.7 75364 3740 ? Ss 14:49 0:00 /opt/httpd/bin/httpd
daemon 58850 0.0 0.5 364328 2556 ? Sl 14:58 0:00 /opt/httpd/bin/httpd
daemon 58914 0.0 0.5 364328 2548 ? Sl 14:59 0:00 /opt/httpd/bin/httpd
daemon 58942 0.0 0.5 364328 2544 ? Sl 14:59 0:00 /opt/httpd/bin/httpd
I then tried attaching to each of the processes individually and applying a breakpoint to the function I am trying to debug. However, the breakpoint never gets triggered, although I know the function is being called. I assume this problem relates to something along the lines of httpd forking on a new process, but I'm a bit stuck on how to proceed. Is there a generic way to ensure my breakpoint is triggered even if the processes forks?
service httpd stop
andgdb httpd -X
. That way, httpd will serve requests, but never fork, which makes things much easier to debug.