473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Fatal Python error: PyEval_RestoreThread: NULL tstate

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
Jul 18 '05 #1
1 10232
> 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

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: vincent wehren | last post by:
Hi, Trying to grasp Py_NewInterpreter()in a simple app embedding Python, I was wondering why the following gives me an error: int main() { PyThreadState *tstate; Py_Initialize();
0
by: Vikram | last post by:
hi, i have a program which uses multiple threads and downloads pages using pycurl and processes these pages among other things. the program works fine with python 2.2 and pycurl 7.10.8 ; with...
7
by: Steve Menard | last post by:
Here is my problem. I have this library thats hosts another language within python, and allows that language to call back INTO python. All is good as long as the other languages calls back on...
2
by: Anand K Rayudu | last post by:
Hi all, I have embedded python and want to execute python scripts from my application. I need to call the execution of python repeatedly, and some times same script again & again. I am facing...
0
by: SHC | last post by:
Hi all, I have a VC++ .NET 2003 - Windows XP Pro PC. I created a Win32 console application in my VC++ .NET 2003 and copied validateDOM.cpp, books.xml and books.xsd (see the attached files below)...
2
by: Philippe C. Martin | last post by:
Hi, I am currently porting some of my applications to U3 (www.u3.com) and I do get a crash in ...objects\frameobject.c: PyFrameObject *back = tstate->frame. The point of the current test is...
1
by: Thomas Korimort | last post by:
Hi! Does anyone know the precise circumstances when the error "Fatal Python error: Py_EndInterpreter: thread still has a frame" does occur. I checked the source code of pythonrun.c, which...
2
by: robert | last post by:
There is a strange freeze/crash only on dual core machines: I have a python app (Python 2.3.5 /Pythonwin build 203 / Windows) running with no stability problems on normal machines (Or a crash is...
3
by: freesteel | last post by:
/* Is this a bug in Py_NewInterpreter? The function below "MyThread" is instantiated from a windows worker thread, but I don't think that is relevant. (I can try this on a linux box, but I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.