RE: Python 2.3.4c1 -- nasty threading bug (Linux)

Discussion in 'Python' started by Tim Peters, May 21, 2004.

  1. Tim Peters

    Tim Peters Guest

    [Dieter Maurer]
    > Python apparently contains a long lasting threading bug on Linux
    > with LinuxThreads.


    Yes, although note that LinuxThreads is an incorrect implementation of the
    phtreads standard in a relevant respect, so you should also say that
    LinuxThreads has a longstanding bug here.

    > SIGSEGV causes hung threads (Linux)
    > http://www.python.org/sf/756924


    ....

    > This problem causes multi-threaded applications such
    > as Zope to enter a funny state when one of the threads crashes.
    > Some of the threads die but others remain and can only be killed
    > with "kill -9". Normal restart logic fails for Zope because of these
    > remaining threads.
    >
    > <mailto:> submitted a patch
    >
    > <http://sourceforge.net/tracker/index.php?func=detail&aid=949332&group_id=
    > 5470&atid=305470>
    >
    > Nevertheless, the problem still exists in Python 2.3.4c1.
    > Either the patch was not applied or it does not fix the problem.


    The patch wasn't applied, and the 2.3.4 release manager doesn't want to risk
    it for 2.3.4. Do read the bug report! There are 36 comments attached (so
    far) because it's a complex problem to solve it correctly. Andrew Langmead
    (whose patch you referenced) is continuing to participate in finding a
    correct solution. See his comment there dated 2004-05-04 10:00 for the
    relevant respect in which LinuxThreads is buggy but NPTL is not.
     
    Tim Peters, May 21, 2004
    #1
    1. Advertising

  2. "Tim Peters" <> writes on Fri, 21 May 2004 14:17:15 -0400:
    > [Dieter Maurer]
    > > Python apparently contains a long lasting threading bug on Linux
    > > with LinuxThreads.

    > ...
    > > This problem causes multi-threaded applications such
    > > as Zope to enter a funny state when one of the threads crashes.
    > > Some of the threads die but others remain and can only be killed
    > > with "kill -9". Normal restart logic fails for Zope because of these
    > > remaining threads.
    > >
    > > <mailto:> submitted a patch
    > >
    > > <http://sourceforge.net/tracker/index.php?func=detail&aid=949332&group_id=
    > > 5470&atid=305470>
    > > ...

    > The patch wasn't applied, and the 2.3.4 release manager doesn't want to risk
    > it for 2.3.4. Do read the bug report! There are 36 comments attached (so
    > far) because it's a complex problem to solve it correctly. Andrew Langmead
    > (whose patch you referenced) is continuing to participate in finding a
    > correct solution. See his comment there dated 2004-05-04 10:00 for the
    > relevant respect in which LinuxThreads is buggy but NPTL is not.


    I verified that the patch mentioned above indeed fixes the problem.

    It might introduce other subtle problems but at least none that
    are revealed by Python's regression test suite...

    Moreover, I doubt that such problems will be significant in practise:

    The patch prevents blocking of signals that should (as specified by the
    pthreads standard)
    not be blocked -- as the operating system uses these signals
    to report serious problems. No application should use
    these threads for application specific communication.

    Therefore, a violation of Python's principle to only
    deliver signals to the main thread seems appropriate
    for these signals.


    It would be great, when the Python developers could come up with
    an even better patch. However, those who run "productive"
    multithreaded Python based applications, especially Zope 2,
    on Linux with LinuxThreads (rather than native PosixThreads)
    may consider to use the patch which is available *now*.

    We will do so. I will report back should we see more serious
    problems than we have now.

    --
    Dieter
     
    Dieter Maurer, May 23, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Berthold Höllmann

    Test error with Python 2.3.4c1

    Berthold Höllmann, May 15, 2004, in forum: Python
    Replies:
    9
    Views:
    365
    Berthold =?iso-8859-15?q?H=F6llmann?=
    May 17, 2004
  2. Dieter Maurer
    Replies:
    0
    Views:
    267
    Dieter Maurer
    May 21, 2004
  3. A. B., Khalid
    Replies:
    1
    Views:
    237
    Michel Claveau - abstraction méta-galactique non t
    Nov 22, 2004
  4. Russ

    Python 2.4c1 vs. 2.4

    Russ, Nov 30, 2004, in forum: Python
    Replies:
    1
    Views:
    277
    Peter Hansen
    Nov 30, 2004
  5. Joey Bersche
    Replies:
    0
    Views:
    300
    Joey Bersche
    Oct 3, 2008
Loading...

Share This Page