[mod_python] Segfaults when running mod_python and mod_php4/mod_php5

Graham Dumpleton grahamd at dscpl.com.au
Tue Dec 13 05:52:53 EST 2005

On 13/12/2005, at 9:44 PM, Daniel S. Reichenbach wrote:

> Hi again,
>> Now use a web browser to access the URL which gives you the problem.
>> If everything goes as expected, Apache will crash and gdb will throw 
>> you
>> back to its prompt. Enter "where" command to get stack trace of where 
>> it
>> crashed.
> I have followed your instructions step by step and tried opening the
> URL. The result was expected, auth window opened, valid username and
> password enter and then again Zero Reply from the server and again it
> show segfault in error log. But *sigh* in gdb nothing happened. It
> still stood there telling me it was Continuing.
> What next?

When you used "ps" to find instances of "httpd" which were running, how
many were there? If there was a pair like in my example, use the pid
of the other. Ie., instead of the lowest pid of the pair, used the 
If there are more than two, or that still doesn't help, you may have to
change your Apache config so that it only starts up at most one child
subprocess. That way when you are attached to it with gdb, you will be
guaranteed the request will be handled by the child process you are

Instead of -DONE_PROCESS, you might also instead try the -X option.

Anyway, you just need to play with it until you work out a reliable
way of ensuring the request is handled by the process attached to gdb.
The only other alternative is to see if you can find a "core" file
which has been dumped by Apache when it crashes and run gdb against it:

   gdb /usr/local/apache-2.0/bin/httpd core

Then use "where" command to get stack trace.

Time for me to sleep, so I'll see how you go in the morning. If you
get a stack trace, others here may be able to help you interpret it.


More information about the Mod_python mailing list