Skip to content

BUG: fix crash on 32 bit systems using abi3t (#31771) - #31949

Merged
charris merged 1 commit into
numpy:maintenance/2.5.xfrom
charris:backport-31771
Jul 10, 2026
Merged

BUG: fix crash on 32 bit systems using abi3t (#31771)#31949
charris merged 1 commit into
numpy:maintenance/2.5.xfrom
charris:backport-31771

Conversation

@charris

@charris charris commented Jul 10, 2026

Copy link
Copy Markdown
Member

Backport of #31771.

PR summary

Fixes #31762

This PR fixes the crash on 32 bit systems when using abi3t ABI. In this PR, the first member of the PyArrayDescr is now aligned to 8 bytes so that regardless of the size of the actual PyObject, the field accesses remain correct. 8 bytes is used instead of alignof(max_align_t) to preserve backwards compatibility with exisiting abi3 extensions where sizeof(PyObject) is a multiple of 8 thereby the added alignment is no-op and does not changes the offset for such extensions.

AI Disclosure

AI was used to create the test.

Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
@charris charris added this to the 2.5.2 release milestone Jul 10, 2026
@charris charris added 08 - Backport Used to tag backport PRs 63 - C API Changes or additions to the C API. Mailing list should usually be notified. labels Jul 10, 2026
@charris
charris merged commit 6419eec into numpy:maintenance/2.5.x Jul 10, 2026
85 checks passed
@charris
charris deleted the backport-31771 branch July 10, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 - Backport Used to tag backport PRs 63 - C API Changes or additions to the C API. Mailing list should usually be notified.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants