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

gh-120321: Fix TSan reported races on gi_frame_state by colesbury · Pull Request #143128 · python/cpython · GitHub

/ cpython Public

gh-120321: Fix TSan reported races on gi_frame_state - #143128

Merged
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-120321-tsan-races
Dec 24, 2025
Merged

gh-120321: Fix TSan reported races on gi_frame_state#143128
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-120321-tsan-races

Conversation

colesbury commented Dec 24, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

This is the same thing as #142995, but I missed a few cases. Again, I think these are false positives in the sense that TSan treats failed compare-exchanges as if they are modifications, when they don't perform any modification on failure.

colesbury requested a review from mpage December 24, 2025 00:24
colesbury marked this pull request as ready for review December 24, 2025 00:24

Copy link
Copy Markdown
Contributor

In _PyGen_Finalize there are a few non-atomic reads of gi_frame_state, does that need fixing as well?

Copy link
Copy Markdown
Contributor Author

No, _PyGen_Finalize is called when there are no other references to the generator (except cycles), so there's no concurrent compare-exchanges on gi_frame_state.

kumaraditya303 commented Dec 24, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

No, _PyGen_Finalize is called when there are no other references to the generator (except cycles), so there's no concurrent compare-exchanges on gi_frame_state.

It is possible that _PyGen_Finalize gets called from frame.clear though so IIUC it is not guaranteed to be called only when there are no other references to generator.

_PyGen_Finalize((PyObject *)gen);

Copy link
Copy Markdown
Contributor Author

That will be fixed in #143112

colesbury merged commit 594a463 into python:main Dec 24, 2025
54 checks passed
colesbury deleted the gh-120321-tsan-races branch December 24, 2025 21:10
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.

2 participants


Back | FazBrowse Home | New Git URL