Skip to content

MAINT: Fix for segfaults with GCC 15 #29132

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
merged 1 commit into from
Jun 5, 2025

Conversation

charris
Copy link
Member

@charris charris commented Jun 5, 2025

GCC 15 generates code that segfaults on newer hardware when running tests. See gh-28991 for details. A fix is to always require alignment, which can be done by setting NPY_ALIGNMENT_REQUIRED = 1.

We retain NPY_ALIGNMENT_REQUIRED here for downstream compatibility in the 2.3.x release series, but do remove its use in our own code. The associated macro NPY_USE_UNALIGNED_ACCESS could also be removed as it is always 0, but that is left for another PR.

This is a stripped down version of #29094.

GCC 15 generates code that segfaults on newer hardware when running
tests. See numpygh-28991 for details. A fix is to always require alignment,
which can be done by setting `NPY_ALIGNMENT_REQUIRED = 1`.

We retain `NPY_ALIGNMENT_REQUIRED` here for downstream compatibility in
the 2.3.x release series, but do remove its use in our own code. The
associated macro `NPY_USE_UNALIGNED_ACCESS` could also be removed as it
is always 0, but that is left for another PR.
@charris charris added this to the 2.3.0 release milestone Jun 5, 2025
@ngoldbaum
Copy link
Member

I'm impressed that you hit three different CI heisenbugs 😄

@charris
Copy link
Member Author

charris commented Jun 5, 2025

I'm impressed that you hit three different CI heisenbugs

I thought it pretty wonderful myself :)

@charris charris merged commit 1e103cd into numpy:maintenance/2.3.x Jun 5, 2025
91 of 94 checks passed
@ngoldbaum
Copy link
Member

Can you merge this branch into main too? Thanks!

@charris
Copy link
Member Author

charris commented Jun 5, 2025

Can you merge this branch into main too

OK

@charris charris deleted the fix-gcc15-compile branch June 5, 2025 18:28
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.

3 participants