Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

JIT executor invalidation is called in unsafe ways which may deadlock #141658

Copy link
Copy link
@Fidget-Spinner

Description

@Fidget-Spinner
Issue body actions

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

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

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
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.