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
Crash in np.vdot
for array-like object
#14247
Comments
Hmm, Do you want to make a PR? (Might be nice to check if there are more similar usages where the error check is missing.) |
Hi, |
Read about our developement workflow. Then you should get to a point where you can run When you are set up, you can start hacking: create a branch, add a failing test ( |
Welcome @Soniyanayak51! To add to what @mattip said: one bit of info that's missing from our docs (I think) is how we work on issues. We don't use the GitHub "assignees" feature, so unless it's clear from recent comments/PR that someone is actively working on an issue, you can just dive in. |
@rgommers @mattip I have added checks for types obtained from PyArray_DescrFromType(). I am not sure if I should add them for PyArray_DESCR() as well. |
Looks like @mattip answered this partly on the PR (I think). Probably better to keep the conversation there.
To add a little: the principle for adding tests normally is to only test the public API. So you'd take
from the issue description above, and add that as a test. It doesn't look like it's necessary to test the C API separately. |
numpy.vdot
may segfault if passed an object that implements__array__
in a non-standard way.The segfault happens in this line of code:
https://github.com/numpy/numpy/blob/master/numpy/core/src/multiarray/multiarraymodule.c#L2245
since
type
may beNULL
ifPyArray_DescrFromType
fails.Reproducing code example:
Error message:
Backtrace:
Numpy/Python version information:
I've reproduced this both on Mac OS X with:
and on an internal Linux build.
This issue was originally reported as google/jax#1162
The text was updated successfully, but these errors were encountered: