Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Fatal Python error: PyEval_RestoreThread: NULL tstate

Reply
Thread Tools

Fatal Python error: PyEval_RestoreThread: NULL tstate

 
 
reinhard
Guest
Posts: n/a
 
      09-11-2003
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


 
Reply With Quote
 
 
 
 
Warren Postma
Guest
Posts: n/a
 
      09-13-2003
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug in python [was: Fatal Python error: ceval: tstate mix-up] Laszlo Nagy Python 0 01-12-2009 08:51 AM
Re: Fatal Python error: ceval: tstate mix-up Laszlo Nagy Python 0 01-09-2009 12:40 PM
Fatal Python error: ceval: tstate mix-up Laszlo Nagy Python 0 01-09-2009 10:11 AM
C API: NULL tstate Patrick Stinson Python 1 02-16-2004 05:56 AM
[PyQT] NULL tstate axel.mittendorf@transfertech.de Python 0 01-15-2004 12:19 PM



Advertisments