FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-117657: TSAN fix race on gstate->young.count by SonicField · Pull Request #118313 · python/cpython · GitHub

/ cpython Public

gh-117657: TSAN fix race on gstate->young.count - #118313

Merged
colesbury merged 16 commits into
python:mainfrom
SonicField:main
Apr 29, 2024
Merged

gh-117657: TSAN fix race on gstate->young.count#118313
colesbury merged 16 commits into
python:mainfrom
SonicField:main

Conversation

SonicField commented Apr 26, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

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.

ghost commented Apr 26, 2024
edited by ghost
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

bedevere-app Bot commented Apr 26, 2024

Copy link
Copy Markdown

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 skip news label instead.

SonicField changed the title hg-117657: TSAN fix race between atomic and none-atomic mutation of tate->young.… gh-117657: TSAN fix race between atomic and none-atomic mutation of tate->young.… Apr 26, 2024
SonicField changed the title gh-117657: TSAN fix race between atomic and none-atomic mutation of tate->young.… gh-117657: TSAN fix race between atomic and none-atomic mutation of gstate->young.… Apr 26, 2024
SonicField changed the title gh-117657: TSAN fix race between atomic and none-atomic mutation of gstate->young.… gh-117657: TSAN fix race on gstate->young.count Apr 26, 2024

bedevere-app Bot commented Apr 26, 2024

Copy link
Copy Markdown

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 skip news label instead.

Copy link
Copy Markdown
Contributor Author

@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.

SonicField marked this pull request as ready for review April 26, 2024 12:12
colesbury self-requested a review April 26, 2024 14:46

colesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks Alex - I left a few comments below

Comment thread Python/gc_free_threading.c Outdated

colesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There are two compiler warnings (see the "Files changed" tab) and the NEWS file can be removed.

Copy link
Copy Markdown
Contributor Author

Hopefullt fixed the compiler warnings (my bad).

colesbury left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks Alex!

colesbury enabled auto-merge (squash) April 29, 2024 19:53
colesbury merged commit 2ba1aed into python:main Apr 29, 2024
Yhg1s added a commit to Yhg1s/cpython that referenced this pull request Sep 29, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL