Skip to content

[3.15] gh-159739: Avoid destroying a remote unwinder cache twice (GH-159982) - #160023

Merged
JelleZijlstra merged 1 commit into
python:3.15from
miss-islington:backport-b577a54-3.15
Oct 21, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.15from
miss-islington:backport-b577a54-3.15

Conversation

@miss-islington

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

Copy link
Copy Markdown
Contributor

In a free-threaded build, if allocating the thread-local bytecode cache fails after the code-object cache has been created, the initializer destroys the first cache and returns an error without clearing its pointer. Failed construction then invokes the unwinder's deallocator, which destroys the same cache again and can crash the profiling process instead of propagating MemoryError.
(cherry picked from commit b577a54)

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

…onGH-159982)

In a free-threaded build, if allocating the thread-local bytecode cache fails after the code-object cache has been created, the initializer destroys the first cache and returns an error without clearing its pointer. Failed construction then invokes the unwinder's deallocator, which destroys the same cache again and can crash the profiling process instead of propagating `MemoryError`.
(cherry picked from commit b577a54)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
@JelleZijlstra
JelleZijlstra merged commit 4bb96fc into python:3.15 Oct 21, 2026
56 checks passed
@miss-islington
miss-islington deleted the backport-b577a54-3.15 branch October 21, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants