8000 gh-128212: Fix race in `_PyUnicode_CheckConsistency` by colesbury · Pull Request #128367 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128212: Fix race in _PyUnicode_CheckConsistency #128367

10000
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

Merged

Conversation

colesbury
Copy link
Contributor
@colesbury colesbury commented Dec 30, 2024

There was a data race on the utf8 field between PyUnicode_SET_UTF8 and _PyUnicode_CheckConsistency. Use the _PyUnicode_UTF8() accessor, which uses an atomic load internally, to avoid the data race.

There was a data race on the utf8 field between `PyUnicode_SET_UTF8` and
`_PyUnicode_CheckConsistency`. Use the `_PyUnicode_UTF8()` accessor,
which uses an atomic load internally, to avoid the data race.
@colesbury colesbury merged commit 8eebe4e into python:main Jan 2, 2025
49 checks passed
@colesbury colesbury deleted the gh-128212-PyUnicode-CheckConsistency branch January 2, 2025 19:02
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…128367)

There was a data race on the utf8 field between `PyUnicode_SET_UTF8` and
`_PyUnicode_CheckConsistency`. Use the `_PyUnicode_UTF8()` accessor,
which uses an atomic load internally, to avoid the data race.
6A75
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.

2 participants
0