Skip to content

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

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

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

Conversation

@SonicField
Copy link
Contributor

@SonicField SonicField commented Apr 26, 2024

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.

Loading
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