Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-157247: Block perf trampoline activation when the main interpreter's JIT is enabled - #157258

Merged
kumaraditya303 merged 3 commits into
python:mainfrom
cocolato:gh-157247
Sep 11, 2026
Merged

gh-157247: Block perf trampoline activation when the main interpreter's JIT is enabled#157258
kumaraditya303 merged 3 commits into
python:mainfrom
cocolato:gh-157247

Conversation

@cocolato

@cocolato cocolato commented Sep 10, 2026

Copy link
Copy Markdown
Member

refer: https://docs.python.org/3/library/sys.html#sys.activate_stack_trampoline

sys.activate_stack_trampoline() checked only the current interpreter's JIT state, even though perf trampoline state is shared across the process. This allowed a subinterpreter to activate perf_jit while the main interpreter's JIT was enabled, causing JIT executors to be published with incorrect unwind information.

Check the main interpreter's JIT state instead, so subinterpreters cannot bypass the restriction.

@cocolato cocolato added type-bug An unexpected behavior, bug, or error topic-JIT labels Sep 10, 2026
@cocolato

Copy link
Copy Markdown
Member Author

@Fidget-Spinner gentle ping

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kumaraditya303
kumaraditya303 merged commit 4c9f267 into python:main Sep 11, 2026
58 checks passed
@Fidget-Spinner Fidget-Spinner added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 11, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @cocolato for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Sep 11, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 11, 2026
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-JIT type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants