-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix thread-safety of interpreter cached object str_replace_inf
(free threading)
#125268
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-free-threading
type-bug
An unexpected behavior, bug, or error
Comments
colesbury
added
type-bug
An unexpected behavior, bug, or error
3.13
bugs and security fixes
topic-free-threading
3.14
new features, bugs and security fixes
labels
Oct 10, 2024
The "TypeVar and related types" fields are initialized during interpreter start-up, so they're fine. |
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Oct 10, 2024
When formatting the AST as a string, infinite values are replaced by 1e309, which evaluates to infinity. The initialization of this string replacement was not thread-safe in the free threading build.
colesbury
changed the title
Thread-safety of interpreter cached objects (free threading)
Fix thread-safety of interpreter cached object Oct 10, 2024
str_replace_inf
(free threading)
colesbury
added a commit
that referenced
this issue
Oct 10, 2024
When formatting the AST as a string, infinite values are replaced by 1e309, which evaluates to infinity. The initialization of this string replacement was not thread-safe in the free threading build.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Oct 10, 2024
…H-125272) When formatting the AST as a string, infinite values are replaced by 1e309, which evaluates to infinity. The initialization of this string replacement was not thread-safe in the free threading build. (cherry picked from commit 427dcf2) Co-authored-by: Sam Gross <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
topic-free-threading
type-bug
An unexpected behavior, bug, or error
Bug report
We have a number of per-interpreter cached objects. Some of these are lazily initialized in a way that is not thread-safe in the free threading build. (See #125221, for example).
We should go through the remaining ones and make sure they are thread-safe.
EDIT: The only remaining field is
str_replace_inf
. Accesses totype_slots_pname
andtype_slots_ptrs
are protected by a lock and the TypeVar fields are initialized once early on with other types.cpython/Include/internal/pycore_global_objects.h
Lines 63 to 85 in 01fc3b3
Linked PRs
The text was updated successfully, but these errors were encountered: