Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-127879: Fix data race in _PyFreeList_Push #127880

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Dec 12, 2024

Writes to the ob_tid field need to use atomics because it may be concurrently read by a non-locking dictionary, list, or structmember read.

Writes to the `ob_tid` field need to use atomics because it may be
concurrently read by a non-locking dictionary, list, or structmember
read.
@colesbury
Copy link
Contributor Author

I tested this locally on top of #126865 and no longer see a TSan failure when running:

TSAN_OPTIONS="suppressions=$(pwd)/Tools/tsan/suppressions_free_threading.txt" ./python -m test test_free_threading -m test_slots -v

@colesbury colesbury merged commit f8dcb82 into python:main Dec 12, 2024
49 checks passed
@colesbury colesbury deleted the gh-127879-freelist branch December 12, 2024 17:59
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
Writes to the `ob_tid` field need to use atomics because it may be
concurrently read by a non-locking dictionary, list, or structmember
read.
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