Skip to content

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

Open
cocolato wants to merge 3 commits into
python:mainfrom
cocolato:gh-157247
Open

gh-157247: Block perf trampoline activation when the main interpreter's JIT is enabled#157258
cocolato wants to merge 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants