[Zope-Coders] Re: Strange segfault in Python threads and linux kernel 2.6

Derrick Hudson dman at dman13.dyndns.org
Wed Jan 19 13:39:40 EST 2005


On Wed, Jan 19, 2005 at 04:16:09PM +1100, Donovan Baarda wrote:
[...]

| After googling around, I found references to recent attempts to resolve
| some signal handling problems in Python threads. There was one post that
| mentioned subtle differences between how Linux 2.4 and Linux 2.6 did
| signals to threads.
| 
| So it seems this is a problem with Python threads and Linux kernel 2.6.

Maybe this information will help you :

    http://marc.theaimsgroup.com/?l=vim-dev&;m=100827301719235&w=2
    http://marc.theaimsgroup.com/?l=vim-dev&;m=100803941216634&w=2
    http://lists.debian.org/debian-user/2002/12/msg03171.html


    Quoting the last paragraph of section 6.6 of "Programming with
    POSIX Threads" by David R. Butenhof:

        It is always best to avoid using signals in conjunction
        with threads.  At the same time, it is often not possible or
        practical to keep them separate.  When signals and threads
        meet, beware.  If at all possible, use only pthread_sigmask
        to mask signals in the main thread, and sigwait to handle
        signals synchronously within a single thread dedicated to
        that purpose.  If you must use sigaction (or equivalent) to
        handle synchronous signals (such as SIGSEGV) within threads,
        be especially cautious.  Do as little work as possible within
        the signal-catching function.


Good luck!

-D

-- 
\begin{humor}
Disclaimer:
If I receive a message from you, you are agreeing that:
   1. I am by definition, "the intended recipient"
   2. All information in the email is mine to do with as I see fit and make
        such financial profit, political mileage, or good joke as it lends
        itself to. In particular, I may quote it on USENET or the WWW.
   3. I may take the contents as representing the views of your company.
   4. This overrides any disclaimer or statement of confidentiality that may
        be included on your message
\end{humor}
 
www: http://dman13.dyndns.org/~dman/            jabber: dman at dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-coders/attachments/20050119/49dcb4ba/attachment.bin


More information about the Zope-Coders mailing list