]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-117657: Fix QSBR race condition (GH-118843) (#118905)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 10 May 2024 15:13:17 +0000 (17:13 +0200)
committerGitHub <noreply@github.com>
Fri, 10 May 2024 15:13:17 +0000 (15:13 +0000)
commit0becae366c9d0b98d3f53849098e76bc8b1ef574
tree909a8c366796ea07aa38db34e1f785a3c4a81412
parent0874a400a86c563cff71847f35674d4e1bcc3957
[3.13] gh-117657: Fix QSBR race condition (GH-118843) (#118905)

`_Py_qsbr_unregister` is called when the PyThreadState is already
detached, so the access to `tstate->qsbr` isn't safe without locking the
shared mutex. Grab the `struct _qsbr_shared` from the interpreter
instead.
(cherry picked from commit 33d20199af65c741bdc908a968edd8dc179b6974)

Co-authored-by: Alex Turner <alexturner@meta.com>
Include/internal/pycore_qsbr.h
Python/pystate.c
Python/qsbr.c
Tools/tsan/suppressions_free_threading.txt