Skip to content

BUG: avoid incorrect type punning in NpyString_acquire_allocators#25958

Merged
charris merged 1 commit into
numpy:mainfrom
ngoldbaum:stringdtype-acquire-allocator-fix
Mar 7, 2024
Merged

BUG: avoid incorrect type punning in NpyString_acquire_allocators#25958
charris merged 1 commit into
numpy:mainfrom
ngoldbaum:stringdtype-acquire-allocator-fix

Conversation

@ngoldbaum
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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