-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-JITtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
We invalidate executors in the following code:
static int
force_instrument_lock_held(PyCodeObject *code, PyInterpreterState *interp)
AND
_PyMonitoring_SetEvents(int tool_id, _PyMonitoringEventSet events)
In the above functions, the world is stopped/the runtime lock is acquired. However, the JIT can invalidate executors. If the pending executors list becomes full, executors will be finalized. This in turn means arbitrary code can run which may try to acquire the runtime lock and cause a deadlock.
I discovered this while working on FT JIT.
CPython versions tested on:
3.15, 3.14, CPython main branch
Operating systems tested on:
No response
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-JITtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error