[mod_python] mod_python with xmlrplib

Chris Jackson christopher.jackson at gmail.com
Wed Jan 26 19:03:53 EST 2005


My results:

ldd httpd
======
        linux-gate.so.1 =>  (0xffffe000)
        libaprutil-0.so.0 => /usr/local/apache/lib/libaprutil-0.so.0
(0x40018000)
        libexpat.so.0 => /usr/lib/libexpat.so.0 (0x40037000)
        libapr-0.so.0 => /usr/local/apache/lib/libapr-0.so.0 (0x40059000)
        librt.so.1 => /lib/tls/librt.so.1 (0x40079000)
        libm.so.6 => /lib/tls/libm.so.6 (0x4008d000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x400b0000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x400dd000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x400f0000)
        libdl.so.2 => /lib/libdl.so.2 (0x40101000)
        libc.so.6 => /lib/tls/libc.so.6 (0x40104000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

ldd lib-dynload/pyexpat.so
==================
        linux-gate.so.1 =>  (0xffffe000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40040000)
        libc.so.6 => /lib/tls/libc.so.6 (0x40051000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

PHP is not installed.

~= Chris =~

On Wed, 26 Jan 2005 18:56:41 -0500, Chris Jackson
<christopher.jackson at gmail.com> wrote:
> It should also be noted that this works fine in the python
> interpreter, but crashes only during runtime when running in the
> context of mod_python.
> 
> ~= Chris =~
> 
> 
> On Wed, 26 Jan 2005 18:55:35 -0500, Chris Jackson
> <christopher.jackson at gmail.com> wrote:
> > On a simliar note, I was just about to post an XML problem I had using
> > regular Python XML (minidom).
> >
> > <myconfig>
> > mod_python version = 3.1.3
> > Apache version = 2.0.52
> > python version = 2.4
> > </myconfig>
> >
> > ...
> > from xml.dom import minidom
> > xmldoc = minidom.parse(myFile.xml)
> > ...
> >
> > After analyzing the logs files, I find segmentation faults occurring causing
> > the page to hand and never get displayed. I have tested this on two
> > separate systems and the results are the same.
> >
> > I will try the methods described above and see what happens.
> >
> > ~= Chris =~
> >
> >
> > On Wed, 26 Jan 2005 18:36:40 -0500, Graham Dumpleton
> > <grahamd at dscpl.com.au> wrote:
> > > Marco Catunda wrote ..
> > > > I haven't been able to use xmlrpclib with mod_python.
> > > > When I import xmlrpclib the apache server crash (segmentation fault),
> > > > the following code will be show it.
> > > >
> > > > =====================================
> > > > from mod_python import apache
> > > > import xmlrpclib
> > > >
> > > > def handler( req ):
> > > >          req.write("Hello World!")
> > > >          return apache.OK
> > > > =====================================
> > > >
> > > > My system:
> > > >    RedHat ES 3
> > > >    Apache 2.0.52
> > > >    Python 2.4
> > > >
> > > > Is there a way to fix it?
> > >
> > > The xmlrpclib module uses a Python XML module which looks like it tries
> > > to use expat.
> > >
> > > >>> import xmlrpclib
> > > >>> import sys
> > > >>> sys.modules.keys()
> > > ['cStringIO', 'copy_reg', 'sre_compile', '_sre', 'site', '__builtin__', 'xml.parsers.expat', 'xml._xmlplus', 'xml.parsers', 'xml.sys', '__main__', 'operator', 'xml.parsers.pyexpat', 'xml', 'posixpath', 'base64', 'binascii', 'pyexpat.errors', 'sre_constants', 're', 'os.path', 'stat', 'zipimport', 'string', 'warnings', 'UserDict', '_xmlplus', 'sys', 'readline', 'types', 'strop', 'sre', 'signal', 'xmlrpclib', 'linecache', 'posix', 'pyexpat.model', 'time', 'exceptions', 'sre_parse', 'os']
> > >
> > > It is a frequent problem that the version of the expat shared library which
> > > is used by the Python modules differs to that which Apache or PHP may
> > > already be using. This difference can result in a server crash.
> > >
> > > You should thus try to determine if you have multiple versions of expat
> > > present and whether these different packages are using different versions.
> > >
> > > On Linux, you might be able to use "ldd" to work this out by running it
> > > on the "httpd" binary, as well as the appropriate .so Python module.
> > >
> > >   ldd /somepath-to-apache-bin-dir/httpd
> > >   ldd /somepath-to-python-module-dir/lib-dynload/pyexpat.so
> > >   ldd /somepath-to-apache-module-dir/*php*.so
> > >
> > > The paths will need to be adjusted obviously.
> > >
> > > Please post the results of ldd if you can as am curious to see if this
> > > does help, I have never suggested trying it before.
> > >
> > > Graham
> > > _______________________________________________
> > > Mod_python mailing list
> > > Mod_python at modpython.org
> > > http://mailman.modpython.org/mailman/listinfo/mod_python
> > >
> >
>


More information about the Mod_python mailing list