[Python-Dev] Strange segfault in Python threads and linux kernel 2.6

Anthony Baxter anthony at interlink.com.au
Tue Jan 25 06:57:55 CET 2005


On Thursday 20 January 2005 12:43, Donovan Baarda wrote:
> On Wed, 2005-01-19 at 13:37 +0000, Michael Hudson wrote:
> > The main oddness about python threads (before 2.3) is that they run
> > with all signals masked.  You could play with a C wrapper (call
> > setprocmask, then exec fop) to see if this is what is causing the
> > problem.  But please try 2.4.
>
> Python 2.4 does indeed fix the problem. Unfortunately we are using Zope
> 2.7.4, and I'm a bit wary of attempting to migrate it all from 2.3 to
> 2.4. Is there any wa  this "Fix" can be back-ported to 2.3?

It's extremely unlikely - I couldn't make myself comfortable with it
when attempting to figure out it's backportedness. While the current
behaviour on 2.3.4 is broken in some cases, I fear very much that 
the new behaviour will break other (working) code - and this is 
something I try very hard to avoid in a bugfix release, particularly
in one that's probably the final one of a series.

Fundamentally, the answer is "don't do signals+threads, you will
get burned". For your application, you might want to instead try 
something where you write requests to a file in a spool directory, 
and have a python script that loops looking for requests, and 
generates responses. This is likely to be much simpler to debug 
and work with. 



Anthony
-- 
Anthony Baxter     <anthony at interlink.com.au>
It's never too late to have a happy childhood.


More information about the Python-Dev mailing list