Fatal Python error: PyEval_RestoreThread: NULL tstate

Discussion in 'Python' started by reinhard, Sep 11, 2003.

  1. reinhard

    reinhard Guest

    Our project was developed with Python 2.0 and includes some Tk 8.3
    extension widgets as well as python extensions using the CXX interface.

    After moving to Python 2.3 and TclTk 8.4 our program hangs with the
    following message:

    Fatal Python error: PyEval_RestoreThread: NULL tstate

    The strange thing is that this happens in a not very predictible way;
    some data is loaded and displayed in a self-made Tk widget. This works
    fine a couple of times and usually crashes when a widget is closed and a
    new one is opend. Debugging the widget code didn't give any hints.

    Does anyone know which changes in python (2.0 -> 2.3) or TclTk/tkinter
    (8.3 -> 8.4) might be responsible for this? Are there any solutions?


    Reinhard Nadrchal
    reinhard, Sep 11, 2003
    #1
    1. Advertising

  2. > Fatal Python error: PyEval_RestoreThread: NULL tstate

    This error happened to me when I used Python embedded into a C app as
    it's script engine. The thread state is a global variable, pointing to
    a thread state object. Something, very literally is causing a change of
    Python thread-state. Abuse of the global interpreter lock could cause
    this, as could sloppily written code, the most common case is when
    something returns (on error condition) and doesn't restore everything to
    the way it was supposed to be on exit of the function. I suspect your
    CXX extensions may be having some kindo f error or exception, and
    something is returning without having properly unlocked or released
    something.... Sorry to be so vague.

    Warren
    Warren Postma, Sep 13, 2003
    #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. [PyQT] NULL tstate

    , Jan 15, 2004, in forum: Python
    Replies:
    0
    Views:
    581
  2. Patrick Stinson

    C API: NULL tstate

    Patrick Stinson, Feb 13, 2004, in forum: Python
    Replies:
    1
    Views:
    298
    RichH
    Feb 16, 2004
  3. Laszlo Nagy

    Fatal Python error: ceval: tstate mix-up

    Laszlo Nagy, Jan 9, 2009, in forum: Python
    Replies:
    0
    Views:
    826
    Laszlo Nagy
    Jan 9, 2009
  4. Laszlo Nagy
    Replies:
    0
    Views:
    430
    Laszlo Nagy
    Jan 9, 2009
  5. Laszlo Nagy
    Replies:
    0
    Views:
    310
    Laszlo Nagy
    Jan 12, 2009
Loading...

Share This Page