FAQ
I'm working on a project that has a multithreaded wxPython
application. I working on an SMP box. Can anyone tell me
what might be causing this to happen?

Fatal Python error: ceval: orphan tstate

--
Greg Copeland, Principal Consultant
Copeland Computer Consulting
--------------------------------------------------
PGP/GPG Key at http://www.keyserver.net
DE5E 6F1D 0B51 6758 A5D7 7DFE D785 A386 BD11 4FCD
--------------------------------------------------

Search Discussions

  • D-Man at Jun 1, 2001 at 3:17 pm

    On Thu, May 31, 2001 at 09:53:16PM -0500, Greg Copeland wrote:
    I'm working on a project that has a multithreaded wxPython
    application. I working on an SMP box. Can anyone tell me
    what might be causing this to happen?

    Fatal Python error: ceval: orphan tstate
    I don't know, but wxWindows might not be thread-safe. I don't yet
    know of a GUI toolkit that is. (GTK+, Swing, and Tkinter aren't) My
    suggestion is to create a thread that is dedicated to interfacing with
    the GUI. All other threads should then send callable objects to that
    thread and request that they are executed a la
    javax.swing.SwingUtilities.invokeLater() in Swing.

    HTH,
    -D
  • Aahz Maruch at Jun 1, 2001 at 4:17 pm
    In article <m2y9rcq5b7.fsf at mouse.copelandconsulting.net>,
    Greg Copeland wrote:
    I'm working on a project that has a multithreaded wxPython
    application. I working on an SMP box. Can anyone tell me
    what might be causing this to happen?

    Fatal Python error: ceval: orphan tstate
    If you're using Python 1.5.2, upgrade to Python 2.x; there's a thread
    bug in 1.5.2 with SMP combined with creating/destroying large numbers of
    threads.
    --
    --- Aahz <*> (Copyright 2001 by aahz at pobox.com)

    Androgynous poly kinky vanilla queer het Pythonista http://www.rahul.net/aahz/
    Hugs and backrubs -- I break Rule 6

    "Characters exist to suffer, you know. An author needs a little sadism
    in her makeup." --Brenda Clough
  • Greg Copeland at Jun 1, 2001 at 6:32 pm
    Arg! In my hurry to get this posted it seems that I left some
    important information out. I'm running Python 2.1 with wxPython
    2.2.5 and wxWindows 2.2.7, though I get the same results with
    2.2.5 as well.

    The application design is using the parent for the GUI and
    threads for communication. Data is passed back and forth via
    Python's Queue class.

    Most of the segs that I get seemingly have to do with threads.
    I think I'm the only SMP user on the project and oddly enough,
    I think I'm the only user seeing issues like this.

    Thanks again. Any more ideas or tips would be wonderful!

    Greg


    aahz at panix.com (Aahz Maruch) writes:
    In article <m2y9rcq5b7.fsf at mouse.copelandconsulting.net>,
    Greg Copeland wrote:
    I'm working on a project that has a multithreaded wxPython
    application. I working on an SMP box. Can anyone tell me
    what might be causing this to happen?

    Fatal Python error: ceval: orphan tstate
    If you're using Python 1.5.2, upgrade to Python 2.x; there's a thread
    bug in 1.5.2 with SMP combined with creating/destroying large numbers of
    threads.
    --
    --- Aahz <*> (Copyright 2001 by aahz at pobox.com)

    Androgynous poly kinky vanilla queer het Pythonista http://www.rahul.net/aahz/
    Hugs and backrubs -- I break Rule 6

    "Characters exist to suffer, you know. An author needs a little sadism
    in her makeup." --Brenda Clough
    --
    Greg Copeland, Principal Consultant
    Copeland Computer Consulting
    --------------------------------------------------
    PGP/GPG Key at http://www.keyserver.net
    DE5E 6F1D 0B51 6758 A5D7 7DFE D785 A386 BD11 4FCD
    --------------------------------------------------
  • Aahz Maruch at Jun 1, 2001 at 7:03 pm
    In article <m2vgmgoxtp.fsf at mouse.copelandconsulting.net>,
    Greg Copeland wrote:
    Arg! In my hurry to get this posted it seems that I left some
    important information out. I'm running Python 2.1 with wxPython
    2.2.5 and wxWindows 2.2.7, though I get the same results with
    2.2.5 as well.

    The application design is using the parent for the GUI and
    threads for communication. Data is passed back and forth via
    Python's Queue class.

    Most of the segs that I get seemingly have to do with threads.
    I think I'm the only SMP user on the project and oddly enough,
    I think I'm the only user seeing issues like this.
    Are you calling any extensions other than wxPython? It sounds like some
    thread is calling into Python when it doesn't have the Global
    Interpreter Lock. Are you sure that threads other than main *don't*
    make any wxPython calls?

    What OS is this on? (I'm assuming SGI, but....)
    --
    --- Aahz <*> (Copyright 2001 by aahz at pobox.com)

    Androgynous poly kinky vanilla queer het Pythonista http://www.rahul.net/aahz/
    Hugs and backrubs -- I break Rule 6

    "Characters exist to suffer, you know. An author needs a little sadism
    in her makeup." --Brenda Clough
  • Greg Copeland at Jun 1, 2001 at 8:52 pm
    No, I've only started trying to figure out exactly where the
    problem is. I haven't been able to spend much time on it yet.
    A number of people have told me to get the ActiveState stuff,
    which I guess I can try just to make sure, but at this point
    I'm pretty sure it's the application and not python and/or
    wxWindows (wxPython). BTW, I can't seem to find wxMutexGUI()
    in wxPython. Is this me overlooking something or is it simply
    not available yet?

    BTW, your conclusion is what I've been thinking too, so I guess
    I'll have to keep looking for this thing.

    Thanks,
    Greg


    aahz at panix.com (Aahz Maruch) writes:
    In article <m2vgmgoxtp.fsf at mouse.copelandconsulting.net>,
    Greg Copeland wrote:
    Arg! In my hurry to get this posted it seems that I left some
    important information out. I'm running Python 2.1 with wxPython
    2.2.5 and wxWindows 2.2.7, though I get the same results with
    2.2.5 as well.

    The application design is using the parent for the GUI and
    threads for communication. Data is passed back and forth via
    Python's Queue class.

    Most of the segs that I get seemingly have to do with threads.
    I think I'm the only SMP user on the project and oddly enough,
    I think I'm the only user seeing issues like this.
    Are you calling any extensions other than wxPython? It sounds like some
    thread is calling into Python when it doesn't have the Global
    Interpreter Lock. Are you sure that threads other than main *don't*
    make any wxPython calls?

    What OS is this on? (I'm assuming SGI, but....)
    --
    --- Aahz <*> (Copyright 2001 by aahz at pobox.com)

    Androgynous poly kinky vanilla queer het Pythonista http://www.rahul.net/aahz/
    Hugs and backrubs -- I break Rule 6

    "Characters exist to suffer, you know. An author needs a little sadism
    in her makeup." --Brenda Clough
    --
    Greg Copeland, Principal Consultant
    Copeland Computer Consulting
    --------------------------------------------------
    PGP/GPG Key at http://www.keyserver.net
    DE5E 6F1D 0B51 6758 A5D7 7DFE D785 A386 BD11 4FCD
    --------------------------------------------------
  • Robin Dunn at Jun 2, 2001 at 3:50 am

    The application design is using the parent for the GUI and
    threads for communication. Data is passed back and forth via
    Python's Queue class.

    Most of the segs that I get seemingly have to do with threads.
    I think I'm the only SMP user on the project and oddly enough,
    I think I'm the only user seeing issues like this.
    This is a known bug that has been around for some time. It only happens on
    SMP hardware, which I don't have yet, so there have been a couple blind
    attempts at a fix that have failed.

    My new SMP motherboard and processors and etc. arrive next week, so
    hopefully soon I'll be able to better understand the problem and then come
    up with a solution. (Just don't tell my wife that all this new hardware
    ($$$) was only bought to squash a bug in free software...)

    NT and Win2k users can work around the problem by telling the OS to keep the
    process on just one processor:

    import win32api, win32process
    cp = win32api.GetCurrentProcess()
    win32process.SetProcessAffinityMask(cp, 1)


    You can keep track of the bug here:
    http://sourceforge.net/tracker/?funcÞtail&aid"3169&group_id˜63&atid
    9863


    --
    Robin Dunn
    Software Craftsman
    robin at AllDunn.com Java give you jitters?
    http://wxPython.org Relax with wxPython!
  • Greg Copeland at Jun 2, 2001 at 7:42 pm
    Thanks! My forehead won't be so sore now! BTW, if you need any help
    working on it, or you just want someone to help test, please let me
    know. I'll be glad to help. Thanks again for the response!!!


    Greg

    P.S. This application does not use wxPostEvent(), so I'm guessing the
    problem doesn't lie there.



    "Robin Dunn" <robin at stop.spam.alldunn.com> writes:
    The application design is using the parent for the GUI and
    threads for communication. Data is passed back and forth via
    Python's Queue class.

    Most of the segs that I get seemingly have to do with threads.
    I think I'm the only SMP user on the project and oddly enough,
    I think I'm the only user seeing issues like this.
    This is a known bug that has been around for some time. It only happens on
    SMP hardware, which I don't have yet, so there have been a couple blind
    attempts at a fix that have failed.

    My new SMP motherboard and processors and etc. arrive next week, so
    hopefully soon I'll be able to better understand the problem and then come
    up with a solution. (Just don't tell my wife that all this new hardware
    ($$$) was only bought to squash a bug in free software...)

    NT and Win2k users can work around the problem by telling the OS to keep the
    process on just one processor:

    import win32api, win32process
    cp = win32api.GetCurrentProcess()
    win32process.SetProcessAffinityMask(cp, 1)


    You can keep track of the bug here:
    http://sourceforge.net/tracker/?funcÞtail&aid"3169&group_id˜63&atid
    9863


    --
    Robin Dunn
    Software Craftsman
    robin at AllDunn.com Java give you jitters?
    http://wxPython.org Relax with wxPython!



    --
    Greg Copeland, Principal Consultant
    Copeland Computer Consulting
    --------------------------------------------------
    PGP/GPG Key at http://www.keyserver.net
    DE5E 6F1D 0B51 6758 A5D7 7DFE D785 A386 BD11 4FCD
    --------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 1, '01 at 2:53a
activeJun 2, '01 at 7:42p
posts8
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase