[mod_python] Apache segfault when using PythonImport

Jack Diederich jack_diederich at email.com
Fri Nov 22 17:46:48 EST 2002


I can't say for cetain what the cause of the segfault is, but I've
posted a potential reason and patches to fix it more than once to this list.

The globals for python imports are not safe, and trivial to make so.  I know
3.x is the gold standard, but patching 2.x for stability shouldn't be out
of the question.

The calls he sites are a VERY good indicator that the global is the problem,
we should just register a cleanup hook to NULL it out and recreate it again if
init()s are called twice.

-jack
> ----- Original Message -----
> From: Peter Bowen <pzb at datastacks.com>
> Date: 22 Nov 2002 16:02:24 -0500 
> To: mod_python at modpython.org
> Subject: [mod_python] Apache segfault when using PythonImport
> 
> 
> > Apache is segfaulting when I use the PythonImport directive.
> > 
> > I have seen it under two slightly different conditions:
> > 
> > A) Apache 1.3.23 (from Red Hat Linux 7.3 errata), Python 2.2.2 without
> > threads, and mod_python 2.7.8
> > 
> > In this case the backtrace shows that the segfault occurs in ap_palloc. 
> > The stack looks like ap_palloc -> ap_pstrdup -> ap_table_add ->
> > directive_PythonImport.
> > 
> > B) Apache 1.3.23 (as above) or Apache 1.3.27, Python 2.2.2 with threads,
> > and mod_python 2.7.8
> > 
> > Different backtrace.  Dies in pthread_mutex_lock, called from
> > PyEval_AcquireLock.
> > 
> > Has anyone had sucess with using PythonImport with python 2.2 on apache
> > 1.3?
> > 
> > Thanks.
> > Peter
> > 
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://www.modpython.org/mailman/listinfo/mod_python
> > 
> > 
> 
> -- 
> _______________________________________________
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
> 
> One click access to the Top Search Engines
> http://www.exactsearchbar.com/mailcom
> 
> 

-- 
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

One click access to the Top Search Engines
http://www.exactsearchbar.com/mailcom




More information about the Mod_python mailing list