-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-129824: fix data races in subinterpreters under TSAN #135794
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
Conversation
🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit be846e8 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135794%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
This also fixes #116909 so more of test_capi tests can be enabled under free-threading TSAN (will do in follow up). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks okay to me, but I don't understand the interaction between type_ready
and subinterpreters very well, so I'd appreciate @ericsnowcurrently's review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM. I've left one mild suggestion and I'll leave it up to you.
FWIW, the relationship with subinterpreters is that the builtin types are "initialized" multiple times. There are certain things that only need to be done the first time, when the main interpreter is initialized, and some that need to be done for each interpreter. This is reflected by "initial".
Thanks @kumaraditya303 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…GH-135794) This fixes the data races in typeobject.c in subinterpreters under free-threading. The type flags and slots are only modified in the main interpreter as all static types are first initialised in main interpreter. (cherry picked from commit b582d75) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
GH-136266 is a backport of this pull request to the 3.14 branch. |
This fixes the data races in typeobject.c in subinterpreters under free-threading. The type flags are only modified in the main interpreter as all static types are first initialized in main interpreter. With the fix the test_interpreter_pool tests have no data races in typeobject.c under TSAN (there are still some unrelated data races in module exec like posix and struct).