PyEval_SetProfileAllThreads is racy under free-threading #132817
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
topic-free-threading
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
PyEval_SetProfileAllThreads
iterates over the list of thread-states without doing anything to stop the world:cpython/Python/ceval.c
Line 2484 in 87b1ea0
In jax-ml/jax#28142, we saw the following TSAN report from a 3.14 freethreaded build:
and reading the code this makes sense;
PyEval_SetProfileAllThreads
does nothing to prevent threads from starting or stopping during its execution.CPython versions tested on:
3.14
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: