GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-117657: TSAN fix race on gstate->young.count by SonicField · Pull Request #118313 · python/cpython

Conversation

@SonicField

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

Uh oh!

There was an error while loading. Please reload this page.

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.

  • Issue: Make TSAN tests pass with the GIL disabled in free-threaded builds #117657

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@SonicField
TSAN fix race between atomic and none-atomic mutation of tate->young.…
e7a4477
…count
@ghost

ghost commented Apr 26, 2024 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SonicField 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
@bedevere-app bedevere-app Bot mentioned this pull request Apr 26, 2024
Make TSAN tests pass with the GIL disabled in free-threaded builds #117657
Closed
@SonicField 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 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
@SonicField
Merge remote-tracking branch 'upstream/main'
14858c2
@bedevere-app

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@blurb-it
📜🤖 Added by blurb_it.
5457972
@SonicField

SonicField commented Apr 26, 2024

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SonicField
SonicField marked this pull request as ready for review April 26, 2024 12:12
@bedevere-app bedevere-app Bot added the awaiting review label Apr 26, 2024
@itamaro itamaro added the topic-free-threading label Apr 26, 2024
@colesbury
colesbury self-requested a review April 26, 2024 14:46
@colesbury colesbury added the skip news label Apr 26, 2024
colesbury
colesbury reviewed Apr 26, 2024
View reviewed changes

@colesbury colesbury left a comment

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Core and Builtins/2024-04-26-12-08-33.gh-issue-117657.D6Zd73.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/gc_free_threading.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

SonicField added 6 commits April 26, 2024 09:38
@SonicField
merge with upstream
d83833c
@SonicField
TSAN: move gc counter reset into critical section
edd9b7b
@SonicField
Resolved merge conflict in Tools/tsan/suppressions_free_threading.txt
e9bae12
@SonicField
Merge branch 'main' of github.com:SonicField/cpython
e1e040c
@SonicField
Merge branch 'main' of github.com:SonicField/cpython
dc97546
@SonicField
Merge branch 'main' of github.com:SonicField/cpython
2f200c9
colesbury
colesbury reviewed Apr 26, 2024
View reviewed changes

@colesbury colesbury left a comment

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@SonicField
TSAN: Fix compiler warning in gc patch
364d1d9
@SonicField

SonicField commented Apr 26, 2024

Copy link
Copy Markdown
Contributor Author

Hopefullt fixed the compiler warnings (my bad).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SonicField and others added 4 commits April 29, 2024 19:35
@SonicField
Merge branch 'main' into main
6ec56ac
@SonicField
Merge branch 'main' into main
ef64718
@SonicField
Merge branch 'main' into main
822f8cc
@SonicField
Remove not require news entry
655e071
@SonicField
Merge branch 'main' of github.com:SonicField/cpython
85b7b5c
colesbury
colesbury approved these changes Apr 29, 2024
View reviewed changes

@colesbury colesbury left a comment

Copy link
Copy Markdown
Contributor

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Apr 29, 2024
@SonicField
Merge branch 'main' into main
29c2696
@colesbury
colesbury enabled auto-merge (squash) April 29, 2024 19:53
@colesbury
colesbury merged commit 2ba1aed into python:main Apr 29, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 29, 2024
Yhg1s added a commit to Yhg1s/cpython that referenced this pull request Sep 29, 2024
@Yhg1s
Revert "pythongh-117657: TSAN fix race on gstate->young.count (pyth…
3155e44
…on#118313)"

This reverts commit 2ba1aed.
@Yhg1s Yhg1s mentioned this pull request Sep 29, 2024
[3.13] GH-124567: Revert the Incremental GC in 3.13 #124770
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@colesbury colesbury colesbury approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news topic-free-threading

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@SonicField @colesbury @itamaro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.