Skip to content

[3.14] gh-159739: Keep SimpleQueue valid after buffer allocation fails (GH-160165) - #160287

Merged
JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-5ce1ef3-3.14
Oct 22, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-5ce1ef3-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

If allocating a SimpleQueue buffer fails, the partially constructed object reports nonzero capacity despite having no storage. A subclass finalizer that calls put() then writes through a NULL pointer and crashes; publish the capacity only after allocation succeeds. Backport to 3.15 and 3.14.
(cherry picked from commit 5ce1ef3)

Co-authored-by: Jelle Zijlstra jelle@openai.com

…pythonGH-160165)

If allocating a SimpleQueue buffer fails, the partially constructed object reports nonzero capacity despite having no storage. A subclass finalizer that calls put() then writes through a NULL pointer and crashes; publish the capacity only after allocation succeeds. Backport to 3.15 and 3.14.
(cherry picked from commit 5ce1ef3)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
@JelleZijlstra
JelleZijlstra merged commit 7d9c808 into python:3.14 Oct 22, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-5ce1ef3-3.14 branch October 22, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants