gh-142534: Avoid TSan warnings in dictobject.c#142544
Merged
colesbury merged 3 commits intopython:mainfrom Dec 11, 2025
Merged
Conversation
There are places we use "relaxed" loads where C11 requires "consume" or stronger. Unfortunately, compilers don't really implement "consume" so fake it for our use in a way that avoids upsetting TSan.
Contributor
Author
|
@DinoV - with this PR, I no longer get warnings for |
Contributor
Author
Yeah, I think that makes sense. |
Contributor
|
I've confirmed this fixes the issues on the lazy imports branch w/ the object.c and unicodeobject.c changes in this diff backed out: https://fb.workplace.com/chat/t/6551713648259080#:~:text=https%3A//github.com/LazyImportsCabal/cpython/commit/470b9e436222ef099c86dde640ea739acf0d5456 |
|
Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Dec 11, 2025
There are places we use "relaxed" loads where C11 requires "consume" or stronger. Unfortunately, compilers don't really implement "consume" so fake it for our use in a way that avoids upsetting TSan. (cherry picked from commit 0a62f82) Co-authored-by: Sam Gross <colesbury@gmail.com>
|
GH-142603 is a backport of this pull request to the 3.14 branch. |
fatelei
pushed a commit
to fatelei/cpython
that referenced
this pull request
Dec 12, 2025
There are places we use "relaxed" loads where C11 requires "consume" or stronger. Unfortunately, compilers don't really implement "consume" so fake it for our use in a way that avoids upsetting TSan.
meta-codesync bot
pushed a commit
to facebookincubator/cinderx
that referenced
this pull request
Feb 18, 2026
Summary: Building wheels is broken right now because cibuildwheel is using a docker container with Python 3.14.2, but our borrowed file now expects Python 3.14.3. See https://github.com/facebookincubator/cinderx/actions/runs/22123173632/job/63947574316 as what an example failure here looks like, the build is complaining about something that was fixed in python/cpython#142544 and landed in Python 3.14.3. There's no great way to map Python version to manylinux docker container version. Claude tells me this is how we would switch to using the latest one. This is a bit of a mess... Reviewed By: yoney Differential Revision: D93613525 fbshipit-source-id: 4531f7dda97ebc3e4f6880154f0fc3c3456f7ab8
meta-codesync bot
pushed a commit
to facebookincubator/cinderx
that referenced
this pull request
Feb 21, 2026
Summary: FT_ATOMIC_LOAD_PTR_CONSUME was added in 3.14.3. When we try to build CinderX for 3.14.2, it breaks because this isn't defined. Follow what the original PR was doing and define it to acquire semantics, which are stronger than consume. See python/cpython#142544 that added this. Reviewed By: yoney Differential Revision: D93925688 fbshipit-source-id: f032caaed424b0f6e883d61627664a8bbd1c5379
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
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.
There are places we use "relaxed" loads where C11 requires "consume" or stronger. Unfortunately, compilers don't really implement "consume" so fake it for our use in a way that avoids upsetting TSan.