Skip to content

[3.15] gh-155363: Fix QSBR slot leak on thread state creation failure (gh-155365) - #155579

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-44e92d4-3.15
Open

[3.15] gh-155363: Fix QSBR slot leak on thread state creation failure (gh-155365)#155579
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-44e92d4-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

In the free-threaded build, new_threadstate() reserves a QSBR thread-state
slot before it can still fail for other reasons, but the failure paths only
called free_threadstate(), which does not know about the reservation.
Restructure code so failure path doesn't leak.
(cherry picked from commit 44e92d4)

Co-authored-by: Neil Schemenauer nas-github@arctrix.com

…ythongh-155365)

In the free-threaded build, new_threadstate() reserves a QSBR thread-state
slot before it can still fail for other reasons, but the failure paths only
called free_threadstate(), which does not know about the reservation.
Restructure code so failure path doesn't leak.
(cherry picked from commit 44e92d4a5922dd8fa61f75834784c2772fdd34ab)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants