Skip to content

gh-157740: Fix crash when multiple threads execute the same code with the JIT enabled - #157855

Open
cocolato wants to merge 2 commits into
python:mainfrom
cocolato:gh-157740
Open

cocolato wants to merge 2 commits into
python:mainfrom
cocolato:gh-157740

Conversation

@cocolato

@cocolato cocolato commented Sep 20, 2026

Copy link
Copy Markdown
Member

When threads share a code object, one thread can install an executor after the tracer records an instruction's argument but before it translates the instruction. The opcode is then ENTER_EXECUTOR, but the translator uses the recorded oparg as the executor index, which can read past the executor array and crash.

Reading the executor index from this_instr->op.arg when handling ENTER_EXECUTOR fixes this.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant