Skip to content

Conversation

@colesbury
Copy link
Contributor

@colesburycolesbury commented Mar 21, 2025

This tells TSAN not to sanitize PyUnstable_InterpreterFrame_GetLine(). There's a possible data race on the access to the frame's instr_ptr if the frame is currently executing. We don't really care about the race. In theory, we could use relaxed atomics for every access to instr_ptr, but that would create more code churn and current compilers are overly conservative with optimizations around relaxed atomic accesses.

We also don't sanitize _PyFrame_IsIncomplete() because it accesses instr_ptr and is called from assertions within PyFrame_GetCode().

This tells TSAN not to sanitize PyUnstable_InterpreterFrame_GetLine(). There's a possible data race on the access to the frame's instr_ptr if the frame is currently executing. We don't really care about the race. In theory, we could use relaxed atomics for every access to `instr_ptr`, but that would create more code churn and current compilers are overly conservative with optimizations around relaxed atomic accesses. We also don't sanitize _PyFrame_IsIncomplete() because it accesses `instr_ptr` and is called from assertions within PyFrame_GetCode().
@colesburycolesbury marked this pull request as ready for review March 21, 2025 17:08
@colesburycolesbury added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 21, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 9213b55 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F131548%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 21, 2025
@colesburycolesbury merged commit da6730c into python:mainMar 24, 2025
128 checks passed
@colesburycolesbury deleted the gh-128421-frame-lasti branch March 24, 2025 13:49
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 1, 2025
…ongh-131548) This tells TSAN not to sanitize `PyUnstable_InterpreterFrame_GetLine()`. There's a possible data race on the access to the frame's `instr_ptr` if the frame is currently executing. We don't really care about the race. In theory, we could use relaxed atomics for every access to `instr_ptr`, but that would create more code churn and current compilers are overly conservative with optimizations around relaxed atomic accesses. We also don't sanitize `_PyFrame_IsIncomplete()` because it accesses `instr_ptr` and is called from assertions within PyFrame_GetCode().
Sign up for freeto 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

@colesbury@bedevere-bot@kumaraditya303