8000 BUG: fix uint alignment asserts in lowlevel loops by charris · Pull Request #12655 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: fix uint alignment asserts in lowlevel loops #12655

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
Jan 3, 2019

Conversation

charris
Copy link
Member
@charris charris commented Jan 3, 2019

Backport of #12626.

Further correction to the debug assert statements in lowlevel_stride_loops.c.src to account for uint alignment, see #12618.

This also updates the unit test so it always fails if the alignment is incorrectly calculated, instead of sporadically failing depending on what malloc gives. That's done by making _aligned_zeros align to the requested alignment yet not twice the alignment.

The particular case that was failing was for 16-byte longdouble, which is 8-byte "uint aligned" but 16-byte "true aligned". (The copy-code copies 16-byte types with two uint64 assignments). So an 8-byte-aligned ptr would go into the uint aligned copy code, but would trip the 16-byte assert statement.

9A0B
@charris charris added this to the 1.16.0 release milestone Jan 3, 2019
@charris charris merged commit 25f1c64 into numpy:maintenance/1.16.x Jan 3, 2019
@charris charris deleted the backport-12626 branch January 3, 2019 21:22
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
0