Message182577
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: https://github.com/albertz/playground/blob/master/testcrash_python_threadlocal.c
This is the Python code: https://github.com/albertz/playground/blob/master/testcrash_python_threadlocal_py.py
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:51 | Albert.Zeyer | set | recipients:
+ Albert.Zeyer |
2013-02-21 02:37:51 | Albert.Zeyer | set | messageid: <1361414271.61.0.154662693899.issue17263@psf.upfronthosting.co.za> |
2013-02-21 02:37:51 | Albert.Zeyer | link | issue17263 messages |
2013-02-21 02:37:50 | Albert.Zeyer | create | |
|