I would recommend not using embedded mode of mod_wsgi but use daemon mode. 
Delegate each application to a separate mod_wsgi daemon process group and then 
set the WSGIApplicationGroup directive to force the use of the main Python 
interpreter context. This avoids problems with Python extension modules which 
haven’t been implemented correctly to work in sub interpreters. The PyXML 
package is one such package.

Some reading:

http://blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html 
<http://blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html>

http://modwsgi.readthedocs.io/en/develop/user-guides/application-issues.html#python-simplified-gil-state-api
 
<http://modwsgi.readthedocs.io/en/develop/user-guides/application-issues.html#python-simplified-gil-state-api>

Graham

> On 23 May 2016, at 3:56 AM, 'Abraham Varricatt' via modwsgi 
> <[email protected]> wrote:
> 
> 
> 
> On Saturday, May 21, 2016 at 2:51:12 AM UTC+5:30, Graham Dumpleton wrote:
>> Actual details is better to help work out what is going on.
> 
> 
> I'm probably going to sound like an idiot, but this got me stumped - I'm 
> aware of the symptoms of my problem, but do not have enough understanding to 
> figure out what might be relevant. After a lot of thinking (and 
> experimentation) I came up with this,
> 
> https://github.com/abrahamvarricatt/modwsgi_env_setup
> 
> It's a Virtualbox-based vagrant environment which replicates the issue (as 
> far as I can tell). Here is they WSGI script which I'm using,
> 
> https://github.com/abrahamvarricatt/modwsgi_env_setup/blob/master/provision/roles/bottle_config/files/dev/bottle.wsgi
> 
> This configuration took me a lot of time, and while I'm not sure how to fix 
> the segmentation fault, I think I've figured out what causes it. Specifically 
> it is the PyXML module. For better or worse, I'm stuck maintaining a lot of 
> code that depends on PyXML. The module isn't available on PyPi and is being 
> installed from the archive. Here is a copy of it,
> 
> https://github.com/abrahamvarricatt/basicdjango/blob/master/outside_pypi/PyXML-0.8.4.tar.gz
> 
> Why am I so sure the issue is with this module? Because if I load up my 
> provisioning script without adding PyXML to my virtualenv, the wsgi page 
> loads up perfectly fine! The moment I install PyXML, the segmentation fault 
> comes back. 
> 
> I'm certain that I'm not mixing up my Python installations, because I'm 
> destroying my virtualbox instance between experiments and not setting it up 
> by hand - all the setup is automate with ansible, including the compiling, 
> configuration and installation.
> 
> It's late for me, but after I get back to work tomorrow morning, I'll post 
> the apache logs I'm getting as well as the GDB stack-trace. 
> 
> Yours,
> Abraham V.
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to