Skip to content

[3.13] gh-117657: Fix QSBR race condition (GH-118843) - #118905

Merged
colesbury merged 1 commit into
python:3.13from
miss-islington:backport-33d2019-3.13
May 10, 2024
Merged

colesbury merged 1 commit into
python:3.13from
miss-islington:backport-33d2019-3.13

Conversation

@miss-islington

@miss-islington miss-islington commented May 10, 2024 •

Copy link
Copy Markdown
Contributor

_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 33d2019)

Co-authored-by: Alex Turner alexturner@meta.com

`_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 33d2019)

Co-authored-by: Alex Turner <alexturner@meta.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants