-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
gh-117657: TSAN fix race on gstate->young.count #118313
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
@DinoV @mpage @colesbury Here is my first go at a pull request. I cannot figure out how to add you are reviewers; I don't think I have permissions to do so or some such. |
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.
Thanks Alex - I left a few comments below
Misc/NEWS.d/next/Core and Builtins/2024-04-26-12-08-33.gh-issue-117657.D6Zd73.rst
Outdated
Show resolved
Hide resolved
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.
There are two compiler warnings (see the "Files changed" tab) and the NEWS file can be removed.
Hopefullt fixed the compiler warnings (my bad). |
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.
Thanks Alex!
…on#118313)" This reverts commit 2ba1aed.
In gc_free_threading.c at line 1016 the gcstate->young.count is batch incremented via an atomic add. However, at 1162 the count is set to zero during garbage collection and that set is not atomic. This causes a race condition with the addition. Changing to an atomic set solves the race.