-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Race on tp_version_tag under free threading #128759
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
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
Comments
Non-atomic read of Lines 1091 to 1102 in 5e65a1a
|
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Jan 12, 2025
sobolevn
added a commit
that referenced
this issue
Jan 13, 2025
kumaraditya303
pushed a commit
that referenced
this issue
Jan 13, 2025
Thanks! |
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Feb 6, 2025
We should use a relaxed atomic load in the free threading build in `PyType_Modified()` because that's called without the type lock held. It's not necessary to use atomics in `type_modified_unlocked()`. We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the `UINT32` variant because `tp_version_tag` is declared as `unsigned int`.
colesbury
added a commit
that referenced
this issue
Feb 12, 2025
We should use a relaxed atomic load in the free threading build in `PyType_Modified()` because that's called without the type lock held. It's not necessary to use atomics in `type_modified_unlocked()`. We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the `UINT32` variant because `tp_version_tag` is declared as `unsigned int`.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Feb 12, 2025
…29750) We should use a relaxed atomic load in the free threading build in `PyType_Modified()` because that's called without the type lock held. It's not necessary to use atomics in `type_modified_unlocked()`. We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the `UINT32` variant because `tp_version_tag` is declared as `unsigned int`. (cherry picked from commit 57f45ee) Co-authored-by: Sam Gross <colesbury@gmail.com>
colesbury
added a commit
that referenced
this issue
Feb 12, 2025
…30042) We should use a relaxed atomic load in the free threading build in `PyType_Modified()` because that's called without the type lock held. It's not necessary to use atomics in `type_modified_unlocked()`. We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the `UINT32` variant because `tp_version_tag` is declared as `unsigned int`. (cherry picked from commit 57f45ee)
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
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
topic-free-threading
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
TSAN reports a data race for the following program in a free-threaded build:
TSAN report:
Tested at Python 3.13 commit 65da5db
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
type_modified_unlocked
#128764type_modified_unlocked
(GH-128764) #128769tp_version_tag
. #129750tp_version_tag
. (GH-129750) #130042The text was updated successfully, but these errors were encountered: