BUG: fix crash in ufunc.resolve_dtypes with a Python scalar type - #32496
Merged
Merged
Conversation
Member
|
related to #31734 ? |
ngoldbaum
force-pushed
the
fix-resolve-dtypes-crash
branch
from
September 3, 2026 21:30
8007907 to
2fc4217
Compare
Member
Author
|
Nah, this is a different error path that is way less likely to be hit in real life. I hit this working on a fix for #32491. |
ngoldbaum
force-pushed
the
fix-resolve-dtypes-crash
branch
from
September 4, 2026 17:06
2fc4217 to
ac93346
Compare
Member
Author
|
Thanks for the review! |
charris
pushed a commit
that referenced
this pull request
Sep 5, 2026
charris
added a commit
that referenced
this pull request
Sep 5, 2026
BUG: fix crash in ufunc.resolve_dtypes with a Python scalar type (#32496)
ngoldbaum
added a commit
to ngoldbaum/numpy
that referenced
this pull request
Sep 8, 2026
ngoldbaum
added a commit
to ngoldbaum/numpy
that referenced
this pull request
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
The Python
ufunc.resolve_dtypeshelper calls into this function without passing an explicit scalar object. This leads to a null-pointer dereference crash generating the error message for any of the cases in the test I added.The fix is to check the operand flags if the scalar is NULL.
AI Disclosure
An AI model found the bug. I wrote the fix and had the model review it.