mod_python - problem with dynamic loading

Oleg Broytmann phd at sun.med.ru
Tue May 4 07:08:25 EDT 1999


Hello!

   I need an advice from guru who understands shared libraries issues.

   I have Python 1.5.1, Apache 1.3.4 and PyApache 4.14.
   Initially I ran all this on Sun, Solaris 2.5.1. All worked pretty good.
Then I tried to move things to linux, but I experienced many troubles.

   First time I started apache with pyapache, I did few simple things -
this worked, - and then ran

import cgi
cgi.test()

   This failed. I looked into apache's error_log and found an error message
from PyApache error handler: unhandled exception - _Py_SOMETHING not found
(I do not remember exact symbol, but I expected this symbol to be exported
from libpython.a, linked with pyapache).

   I looked into pyapache mailing list and found I am not alone:
http://www.egroups.com/group/pyapache-devel/132.html
   His have got almost the same configuration (and he, like me, runs
postgres).
   I started experiment and removed mod_auth_pgsql from apache. PyApache
worked! This was on Debian 2.1; I tried to move recompile pyapache on
RedHat 5.1. Compiled, but refused to work. Apache's error_log shows:
segmentation fault.
   Then I recompiled apache on debian adding mod_auth_pgsql back. PyApache
worked for some time, but then started to do the same segmentation fault.

   This time I've got yet another linux - RH 5.2. I am not a sysadmin
there, so instructed a sysadmin how to compile python and pyapache.
PyApache worked on that computer... until I looked into error_log. I found
segmentation faults there. But all my scripts worked, so I think
segmentation fault occurred after a script.
   For some reasons apache on the computer was recompiled few times - added
mod_perl, then mod_auth_mysql. PyApache always worked; sometimes there are
segmentation faults, sometimes there are not.

   Recently I upgraded my sun and 2 linux systems to python 1.5.2 and
apache 1.3.6. Nothing changed - pyapache worked on sun without minor
trouble, but on Linux _Py_NoneStruct not found or segmentation fault.
"_Py_NoneStruct not found" usually appeared when I am trying to import time
or socket (via urllib or cgi) - python tried to load timemodule.so or
socketmodule.so - and failed. :(

   Anyone understand what is going on? Any advice how to fix this?

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list