[issue38106] Race in PyThread_release_lock - can lead to memory corruption and deadlock

Armin Rigo report at bugs.python.org
Wed Sep 11 10:57:08 EDT 2019


Armin Rigo <arigo at users.sourceforge.net> added the comment:

I may be wrong, but I believe that the bug requires using the C API (not just pure Python code).  This is because Python-level lock objects have their own lifetime, and should never be freed while another thread is in PyThread_release_lock() with them.

Nevertheless, the example shows that using this C API "correctly" is very hard.  Most direct users of the C API could run into the same problem in theory.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38106>
_______________________________________


More information about the Python-bugs-list mailing list