Skip to content

gh-140263: Fix data race in test_lock_two_threads#140264

Merged
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-140263-test_lock_two_threads
Oct 20, 2025
Merged

gh-140263: Fix data race in test_lock_two_threads#140264
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-140263-test_lock_two_threads

Conversation

@colesbury

@colesbury colesbury commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

Clang-20 detects a data race between the unlock and the non-atomic read of the lock state. Use a relaxed load for the assertion to avoid the race.

Clang-20 detects a data race between the unlock and the non-atomic
read of the lock state. Use a relaxed load for the assertion to avoid
the race.
@colesbury colesbury added skip news needs backport to 3.14 bugs and security fixes labels Oct 17, 2025
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Oct 17, 2025
@colesbury colesbury marked this pull request as ready for review October 17, 2025 17:44
@colesbury colesbury merged commit f11ec6e into python:main Oct 20, 2025
55 checks passed
@colesbury colesbury deleted the gh-140263-test_lock_two_threads branch October 20, 2025 13:58
@miss-islington-app

Copy link
Copy Markdown

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 Oct 20, 2025
)

Clang-20 detects a data race between the unlock and the non-atomic
read of the lock state. Use a relaxed load for the assertion to avoid
the race.
(cherry picked from commit f11ec6e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@bedevere-app

bedevere-app Bot commented Oct 20, 2025

Copy link
Copy Markdown

GH-140369 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 Oct 20, 2025
colesbury added a commit that referenced this pull request Oct 20, 2025
…h-140369)

Clang-20 detects a data race between the unlock and the non-atomic
read of the lock state. Use a relaxed load for the assertion to avoid
the race.
(cherry picked from commit f11ec6e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
)

Clang-20 detects a data race between the unlock and the non-atomic
read of the lock state. Use a relaxed load for the assertion to avoid
the race.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants