[mod_python] Mod_python quit working

Graham Dumpleton grahamd at dscpl.com.au
Wed Jan 12 18:48:15 EST 2005


Monsyne Dragon wrote ..
> >> What does it say in the apache logs?
> >
> >
> > [Tue Jan 11 06:03:25 2005] [notice] mod_python: (Re)importing rose 
> > from None
> > [Tue Jan 11 06:03:25 2005] [notice] mod_python: (Re)importing rose 
> > from None
> > [Tue Jan 11 06:03:25 2005] [notice] child pid 2243 exit signal 
> > Segmentation fault (11)
> > [Tue Jan 11 06:03:25 2005] [notice] child pid 8161 exit signal 
> > Segmentation fault (11)
> > [Tue Jan 11 06:03:33 2005] [notice] mod_python: (Re)importing rose 
> > from None
> > [Tue Jan 11 06:03:33 2005] [notice] child pid 2245 exit signal 
> > Segmentation fault (11)
> 
> This is likely a hardware issue.  Possibly RAM going bad, (or possibly
> even a dead CPU fan!)
> When you hit the page the server process is having it's memory corrupted
> (thus the Signal 11 segfault),
> and dies w/ no reply.

Lets be realistic here. If there were hardware issues it is likely to manifest
randomly and not be repeatable and more than likely the operating system
as a whole would have crashed somewhat earlier than this point.

I really don't get this blaming the hardware thing. This is the second time
I have seen this recently given as a solution to a segmentation fault problem.
This isn't helpful. Do you not understand what causes segmentation faults
in the first place?

Sorry, I just had to say this and if my day was going any worse I wouldn't
have been so polite about it. :-)

Now, can we go backwards on this a bit and try and debug this in a more
sensible way.

First off, everything was supposedly working okay and then it started
having this problem. Restarts of Apache didn't appear to fix anything.
Even returning a simple string didn't appear to work.

I am making an assumption here that the simple string was being returned
from a mod_python handler. Instead of worrying about that for the moment,
can the original poster answer the following questions.

1. Does a normal static web page served up from a directory nothing to
do with the mod_python area work? If it does, then Apache itself isn't
necessarily stuffed.

2. How have you set up your httpd.conf/htaccess file to enable use of
mod_python in the directory you are accessing and is causing the problem?
Post the actual directives you put in the config file here otherwise we
would be guessing. Let us work out if you are doing anything strange.

3. If you comment out all your existing config file entries for enabling
mod_python in that directory (or any directories for that matter) and go
back to square one and in a new directory, setup a bog standard mptest.py
example as per mod_python documentation, does it work? Ie., take out
of the picture any of your own personalised handlers.

Once you have done that and if you can get a simple mptest.py working
in clean area, then looking at your particular code at what dependencies
it has would be appropriate.

Overall, segmentation faults in mod_python are more likely to be caused
by Apache, mod_python and Python being built with differing ideas of
how threading is supposed to be enabled. Another possibility is that
differing Apache extension modules have been built against different
versions of shared libraries. A good example where this often happens is
the expat library, since it can be loded by Python code running under
mod_python and PHP code running in the same Apache process. If a
different version of expat is used, something might crash if data layouts
are different.

Anyway, if the original poster can try and answer the above you might
perhaps get some more useful feedback.




More information about the Mod_python mailing list