I have been having a few more discussions around about this, and I'm starting to think that this is a bug.
My take is that, when I call Py_Finalize, the python thread should be shut down gracefully, closing the file and everything.
Maybe I'm missing a call to something (?PyEval_FinalizeThreads?) but the docs seem to say that just PyFinalize should be called.
The open file seems to be the issue, since if I remove all the references to the file I cannot get the program to crash.
I can reproduce the same behavior on two different wxp systems, under python 2.4 and 2.4.1.
Ugo
-----Original Message-----
From: Ugo Di Girolamo
Sent: Tuesday, April 26, 2005 2:16 PM
To: 'python-dev@python.org'
Subject: Problem with embedded python
I have the following code, that seems to make sense to me.
However, it crashes about 1/3 of the times.
My platform is Python 2.4.1 on WXP (I tried the release version from
the msi and the debug version built by me, both downloaded today to
have the latest version).
The crash happens while the main thread is in Py_Finalize.
I traced the crash to _Py_ForgetReference(op) in object.c at line 1847,
where I have op->_ob_prev == NULL.
What am I doing wrong? I'm definitely not too sure about the way I'm
handling the GIL.
Thanks in adv for any suggestion/ comment
Cheers and ciao
Ugo
////////////////////////// TestPyThreads.py //////////////////////////
#include
participants (1)
-
Ugo Di Girolamo