mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
[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 33d20199af)
Co-authored-by: Alex Turner <alexturner@meta.com>
This commit is contained in:
parent
0874a400a8
commit
0becae366c
4 changed files with 8 additions and 8 deletions
|
|
@ -1794,7 +1794,7 @@ tstate_delete_common(PyThreadState *tstate)
|
|||
HEAD_UNLOCK(runtime);
|
||||
|
||||
#ifdef Py_GIL_DISABLED
|
||||
_Py_qsbr_unregister((_PyThreadStateImpl *)tstate);
|
||||
_Py_qsbr_unregister(tstate);
|
||||
#endif
|
||||
|
||||
// XXX Unbind in PyThreadState_Clear(), or earlier
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue