[mod_python] psp.PSP(req, string='hello world') causes segfault

Damjan gdamjan at mail.net.mk
Tue Apr 26 18:20:14 EDT 2005

> --- newversion.py -----------
> from mod_python import apache
> from mod_python import psp
> def handler(req):
>     content_file = psp.PSP(req, string='hello world')
>     content_file.run()
>     return apache.OK
> -----------------------------

On slackware-10.1, python-2.4, Apache-2.0.53, modpython-3.1.4 I get:

Mod_python error: "PythonHandler mptest"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
    result = object(req)

  File "/home/www/modpython/mptest.py", line 37, in handler
    return psptest(req)

  File "/home/www/modpython/mptest.py", line 43, in psptest
    content_file = psp.PSP(req, string='hello world')

  File "/usr/lib/python2.4/site-packages/mod_python/psp.py", line 114, in __init__
    cached = strcache.get(string)

NameError: global name 'strcache' is not defined

Now searching google, finds this: 
But even after making the change in psp.py... then I get a segfault and this in
apache's error.log:
[Wed Apr 27 00:18:58 2005] [notice] mod_python: (Re)importing module 'mptest'
*** glibc detected *** double free or corruption (fasttop): 0x083c2db8 ***
DeprecationWarning: Non-ASCII character '\xe2' in
 file /home/www/modpython/mptest.py on line 10, but no encoding
declared; see http://www.python.org/peps/pep-0263.html for details
[Wed Apr 27 00:18:59 2005] [notice] child pid 422 exit signal Aborted (6)

damjan | дамјан
This is my jabber ID --> damjan at bagra.net.mk <-- not my mail address!!!

More information about the Mod_python mailing list