Skip to content

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Dec 10, 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.

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.
@colesbury
Copy link
Contributor Author

@DinoV - with this PR, I no longer get warnings for test_concurrent_reification_multiple_modules from the lazy imports tree.

@colesbury colesbury requested a review from mpage December 11, 2025 14:42
Copy link
Member

@Yhg1s Yhg1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backport to 3.14?

@colesbury
Copy link
Contributor Author

Backport to 3.14?

Yeah, I think that makes sense.

@DinoV
Copy link
Contributor

DinoV commented Dec 11, 2025

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

Copy link
Contributor

@DinoV DinoV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woot!

@colesbury colesbury merged commit 0a62f82 into python:main Dec 11, 2025
44 checks passed
@miss-islington-app
Copy link

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@colesbury colesbury deleted the gh-142534-consume branch December 11, 2025 21:23
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 <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 11, 2025

GH-142603 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Dec 11, 2025
colesbury added a commit that referenced this pull request Dec 11, 2025
…-142603)

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 <[email protected]>
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.
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