FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-117657: Fix data race in `_Py_IsImmortal` by mpage · Pull Request #118261 · python/cpython · GitHub

/ cpython Public

gh-117657: Fix data race in _Py_IsImmortal - #118261

Merged
colesbury merged 1 commit into
python:mainfrom
mpage:gh-117657-is-immortal
Apr 25, 2024
Merged

gh-117657: Fix data race in _Py_IsImmortal#118261
colesbury merged 1 commit into
python:mainfrom
mpage:gh-117657-is-immortal

Conversation

mpage commented Apr 24, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

The load of ob_ref_local:

return (op->ob_ref_local == _Py_IMMORTAL_REFCNT_LOCAL);

races with stores (example):

_Py_atomic_store_uint32_relaxed(&op->ob_ref_local, local);

Using a relaxed load is sufficient; stores to the field are relaxed.

colesbury merged commit f14e9f9 into python:main Apr 25, 2024
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL