Skip to content

[3.13] gh-128759: Fix accesses to tp_version_tag. (GH-129750)#130042

Merged
colesbury merged 2 commits into
python:3.13from
colesbury:backport-57f45ee-3.13
Feb 12, 2025
Merged

[3.13] gh-128759: Fix accesses to tp_version_tag. (GH-129750)#130042
colesbury merged 2 commits into
python:3.13from
colesbury:backport-57f45ee-3.13

Conversation

@colesbury

@colesbury colesbury commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

We should use a relaxed atomic load in the free threading build in PyType_Modified() because that's called without the type lock held. It's not necessary to use atomics in type_modified_unlocked().

We should also use FT_ATOMIC_STORE_UINT_RELAXED() instead of the UINT32 variant because tp_version_tag is declared as unsigned int.
(cherry picked from commit 57f45ee)

…29750)

We should use a relaxed atomic load in the free threading build in
`PyType_Modified()` because that's called without the type lock held.
It's not necessary to use atomics in `type_modified_unlocked()`.

We should also use `FT_ATOMIC_STORE_UINT_RELAXED()` instead of the
`UINT32` variant because `tp_version_tag` is declared as `unsigned int`.
(cherry picked from commit 57f45ee)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@colesbury
colesbury merged commit 2fbc986 into python:3.13 Feb 12, 2025
@colesbury
colesbury deleted the backport-57f45ee-3.13 branch February 12, 2025 15:43
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