Skip to content

BUG: avoid incorrect type punning in NpyString_acquire_allocators #25958

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
Mar 7, 2024

Conversation

ngoldbaum
Copy link
Member

@ngoldbaum ngoldbaum commented Mar 7, 2024

Fixes #25957. It may also fix the hangs on sanitizer CI too, we'll have to see.

I think merging #25943 made this more visible, but it was always buggy to do this.

The issue is that descrs doesn't necessarily contain only PyArray_StringDTypeObject instances, so it's incorrect to cast (say) a LONG descriptor to PyArray_StringDTypeObject in the following line.

The fix is to check for this case and skip the cast if the descriptor we want to compare with isn't a stringdtype descriptor.

@ngoldbaum
Copy link
Member Author

Sanitizers CI passed, merging this should unbreak it on main.

@charris charris merged commit 0cbdbc2 into numpy:main Mar 7, 2024
@charris
Copy link
Member

charris commented Mar 7, 2024

Thanks Nathan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: address sanitizer test failure in new string dtype
2 participants