FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-159739: Avoid destroying a remote unwinder cache twice by jelle-openai · Pull Request #159982 · python/cpython · GitHub

Repository navigation

gh-159739: Avoid destroying a remote unwinder cache twice - #159982

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-remote-unwinder-cache-error
Oct 21, 2026
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-remote-unwinder-cache-error

Conversation

jelle-openai commented Oct 20, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

Avoid destroying a remote unwinder cache twice; it will get destroyed in the dealloc method. 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.

JelleZijlstra added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 20, 2026
JelleZijlstra merged commit b577a54 into python:main Oct 21, 2026
62 checks passed

Copy link
Copy Markdown

Thanks @jelle-openai for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

Copy link
Copy Markdown

Sorry, @jelle-openai and @JelleZijlstra, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker b577a5403ad513e6f28ec28630b5ee09a5f521ab 3.14

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

GH-160023 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

GH-160084 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 21, 2026
JelleZijlstra pushed a commit that referenced this pull request Oct 21, 2026
…159982) (#160023)

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 pushed a commit that referenced this pull request Oct 21, 2026
…159982) (#160084)

Leave cleanup of the code-object cache to the unwinder deallocator if
allocating the thread-local bytecode cache fails.

(cherry picked from commit b577a54)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL