Skip to content Skip to sidebar Skip to footer

Django Wsgi Application Segfault

so i'm getting segfaults with my django wsgi application in mod_wsgi via apache 2.22 here's the wsgi app: import os import sys sys.path.append('/home/***.com/zpencerq') sys.path.a

Solution 1:

Quoting from mod_wsgi docs:

Q: Why when first request is made against a WSGI application does the Apache server process handling the request crash with a 'segmentation fault'?

A: This is nearly always caused due to a shared library version conflict. That is, Apache or some Apache module is linked against a different version of a library than that which is being used by a particular Python module that the WSGI application makes use of. The most common culprits are the expat and MySQL libraries, but it can also occur with other shared libraries.

Another cause of a process crash only upon the first request can be a third party C extension module for Python which has not been implemented so as to work within a secondary Python sub interpreter. The Python bindings for Subversion are a particular example, with the Python module only working correctly if the WSGI application is forced to run within the first interpreter instance created by Python.

Further information on these problems can be found in various sections of Application Issues. The problems with the expat library are also gone into in more detail in Issues With Expat Library.

I see you have Apache and Python both installed at /usr/local/, so I assume you have compiled them. You have to make sure the C extensions used in your code are linked against the right versions too. The other option is, you're using some buggy module that behaves badly when loaded via mod_wsgi.

Can you run your application without mod_wsgi, running ./manage.py for instance?

Post a Comment for "Django Wsgi Application Segfault"