Created
September 14, 2009 18:36
-
-
Save dap/186834 to your computer and use it in GitHub Desktop.
Debug segfault on Solaris
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to debug an Apache segfault on Solaris 10 | |
1. Ensure that the /var/core directory exists. | |
2. $ mdb /usr/local/sbin/httpd | |
3. At the MDB prompt: | |
> ::run -X | |
The "-X" above is actually a parameter to the httpd binary. | |
4. Do whatever makes it segfault. | |
5. Get a stack dump from mdb: | |
> ::stack | |
6. Fix your shit up. | |
mdb will follow forks, so when Apache forks a child process to handle the request, | |
you can opt to follow that or stay with the parent. Likewise, if Apache goes to | |
invoke a CGI, you can opt to follow the CGI. Very useful. "::dcmds" will show | |
additional commands which can be run such as "::getenv", "::stackregs", "::nm", | |
"::objects", and "::mappings". Word. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment