-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Race in PyUnicode_InternFromString under free-threading #128137
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
Comments
We want to be able to read In summary:
|
@hawkinsp ae23a01 is now merged, so it should be okay at 3.14, but we are not going to backport this patch into 3.13 since it will raise compatibility issue who use Python 3.13 with GIL and free-threaded build. See: #128196 (comment) |
…he atomic operation (pythongh-128196)
…he atomic operation (pythongh-128196)
Bug report
Bug description:
Here's a race reported by thread sanitizer that I haven't been able to find a small reproducer for, but it does look racy reading the code.
I think the scenario here is:
intern_common
immortalizing the string, which sets the.interned
field on the string.kind
field.The
.kind
and.interned
fields are bitfields in the same word, so this is a race, and I can't see any synchronization or atomicity that would prevent it.Perhaps we need to hold the critical section on the intern dictionary longer, until immortalization is complete?
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: