Skip to content

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

@mpagempage commented Apr 24, 2024

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.

Sign up for freeto 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

@mpage@colesbury