GeezerVison is showing github.com — gh-120321: Fix TSan reported race in gen_clear_frame by colesbury · Pull Request #142995 · python/cpython
Conversation
colesbury
commented
Dec 19, 2025
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
TSan treats compare-exchanges that fail as if they are writes so there is a false positive with the read of gi_frame_state in gen_close.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
TSan treats compare-exchanges that fail as if they are writes
so there is a false positive with the read of gi_frame_state in
gen_close.
|
I keep making this same mistake. This Should fix https://github.com/python/cpython/actions/runs/20383044472/job/58577900039?pr=142957:
WARNING: ThreadSanitizer: data race (pid=21767)
Read of size 1 at 0x7f9ccb6ceb63 by thread T475:
#0 gen_clear_frame /home/runner/work/cpython/cpython/Objects/genobject.c:156:5 (python+0x2afcde) (BuildId: edcf083ae7c4567c86d1e5be11648e5caf6d5047)
#1 gen_close /home/runner/work/cpython/cpython/Objects/genobject.c (python+0x2ac1d1) (BuildId: edcf083ae7c4567c86d1e5be11648e5caf6d5047)
#2 method_vectorcall_NOARGS /home/runner/work/cpython/cpython/Objects/descrobject.c:448:24 (python+0x289784) (BuildId: edcf083ae7c4567c86d1e5be11648e5caf6d5047)
#3 _PyObject_VectorcallTstate /home/runner/work/cpython/cpython/./Include/internal/pycore_call.h:136:11 (python+0x26a6ab) (BuildId: edcf083ae7c4567c86d1e5be11648e5caf6d5047)
...
Previous atomic write of size 1 at 0x7f9ccb6ceb63 by thread T472:
#0 _Py_atomic_compare_exchange_int8 /home/runner/work/cpython/cpython/./Include/cpython/pyatomic_gcc.h:75:10 (python+0x2b0751) (BuildId: edcf083ae7c4567c86d1e5be11648e5caf6d5047)
#1 gen_send_ex /home/runner/work/cpython/cpython/Objects/genobject.c:327:15 (python+0x2b0751)
#2 gen_iternext /home/runner/work/cpython/cpython/Objects/genobject.c:720:9 (python+0x2acf7c) (BuildId: edcf083ae7c4567c86d1e5be11648e5caf6d5047)
#3 _PyForIter_VirtualIteratorNext /home/runner/work/cpython/cpython/Python/ceval.c:4056:24 (python+0x520502) (BuildId: edcf083ae7c4567c86d1e5be11648e5caf6d5047)
#4 _PyEval_EvalFrameDefault /home/runner/work/cpython/cpython/Python/generated_cases.c.h:5500:36 (python+0x4f33f8) (BuildId: edcf083ae7c4567c86d1e5be11648e5caf6d5047)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cocolato
pushed a commit
to cocolato/cpython
that referenced
this pull request
Dec 22, 2025
…142995)
TSan treats compare-exchanges that fail as if they are writes
so there is a false positive with the read of gi_frame_state in
gen_close.
Reviewers
mpage
mpage approved these changes
markshannon
Awaiting requested review from markshannon
markshannon is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.