This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Albert.Zeyer
Recipients Albert.Zeyer
Date 2013-02-21.02:37:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
If you have some Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS in some tp_dealloc and you use such objects in thread local storage, you might get crashes, depending on which thread at what time is trying to cleanup such object.

I haven't fully figured out the details but I have a somewhat reduced testcase. Note that I encountered this in practice because the sqlite connection object does that (while it disconnects, the GIL is released).

This is the C code with some dummy type which has a tp_dealloc which just sleeps for some seconds while the GIL is released:

This is the Python code:

The Python code also contains some code path with a workaround which I'm using currently to avoid such crashes in my application.
Date User Action Args
2013-02-21 02:37:51Albert.Zeyersetrecipients: + Albert.Zeyer
2013-02-21 02:37:51Albert.Zeyersetmessageid: <>
2013-02-21 02:37:51Albert.Zeyerlinkissue17263 messages
2013-02-21 02:37:50Albert.Zeyercreate