[mod_python] apache2 + mod_python + mod_php segfaults

Graham Dumpleton grahamd at dscpl.com.au
Tue May 24 00:16:05 EDT 2005

Martin Lesser wrote ..
> Graham Dumpleton <grahamd at dscpl.com.au> writes:
> > In summary it is generally because parts of mod_php have been compiled
> > against different versions of shared libraries than mod_python.
> Ok. But this does not explain whether this is a bug in apache or
> mod_php. For me it remains confusing that one (apache-) module may cause
> a segfault in apache due to the existance of another module.

It isn't a bug in mod_php or Apache or mod_python.

The problem is usually because different versions of some third party
library have been used when compiling parts of Apache, mod_python
or mod_php. When everything is run up, the shared library which is
found first is that which is used for all bits with the dependency on it.
If these different library versions have different structure layouts, when
a module is initialised which has a different concept of structure layout
than the actual shared library being used, then the code can crash.

Thus it is an environment issue related to compilation of the software
and not a bug in any. Ie., Win32 DLL hell on Linux.

An example of shared library problems, although probably not in your
case is that Python 2.4 embeds a copy of libexpat equivalent to 1.95.8.
If your system has a older shared library version of expat and something
in mod_php compiles against it, you will get a crash when you use any
XML module in Python.

The FAQ entry quoted also mentions other cases such as problems with
MySQL and libpng.

In your case, since the problem went away when you took CDB support
out of PHP at the same time as using a CDB module in Python, it is possibly
the shared library used for CDB when compiling mod_php was different
to that when the CDB module in Python was built.


More information about the Mod_python mailing list