]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-106883 Fix deadlock in threaded application (#117332)
authorDiego Russo <diego.russo@arm.com>
Tue, 11 Mar 2025 15:31:03 +0000 (15:31 +0000)
committerGitHub <noreply@github.com>
Tue, 11 Mar 2025 15:31:03 +0000 (15:31 +0000)
commit6b37486184590d19c6f24e620545ec8f8f65e4c7
tree5d684ea756ca1a56f1048e41765d157c1515e30d
parentf1897d312e16bdf820ee47de053fdc24f621d0b1
[3.11] gh-106883 Fix deadlock in threaded application (#117332)

When using threaded applications, there is a high risk of a deadlock in
the interpreter. It's a lock ordering deadlock with HEAD_LOCK(&_PyRuntime); and the GIL.

By disabling the GC during the _PyThread_CurrentFrames() and
_PyThread_CurrentExceptions() calls fixes the issue.
Lib/test/test_sys.py
Misc/NEWS.d/next/C API/2024-04-05-14-32-21.gh-issue-106883.OKmc0Q.rst [new file with mode: 0644]
Python/pystate.c