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
BUG: Segmentation fault when unpickling an empty ndarray with a none-zero dimension #21009
Comments
I am very confused why our tests appear to not catch this at least when running in valgrind (at least I assume that they should). I am pretty sure I know the issue, but it should be a fairly straight forward fix if anyone wants to go bug hunting with EDIT: silly me, you need the empty array, and we likely don't have a test with empty arrays. |
I traced the problem down using |
Yes, that is all correct. The "deprecated" stuff isn't a worry, it only applies to users outside of NumPy anyway (and even then isn't problematic). |
@doctormartin67 thanks for looking into this, @alexdesiqueira had just started on this yesterday and opened a PR now, sorry about that bad timing. |
@seberg No worries, always have fun taking a look at seg faults in |
Changing num to the number of bytes in the input array, PyArray_NBYTES(self). Solves #21009. * Fixing nbyte size in methods.c:memcpy * Adding a test * Re-adding removed newline * Shrinking the test array to save memory
…y#21067) Changing num to the number of bytes in the input array, PyArray_NBYTES(self). Solves numpy#21009. * Fixing nbyte size in methods.c:memcpy * Adding a test * Re-adding removed newline * Shrinking the test array to save memory
…y#21067) Changing num to the number of bytes in the input array, PyArray_NBYTES(self). Solves numpy#21009. * Fixing nbyte size in methods.c:memcpy * Adding a test * Re-adding removed newline * Shrinking the test array to save memory
@seberg This is fixed, correct? |
…y#21067) Changing num to the number of bytes in the input array, PyArray_NBYTES(self). Solves numpy#21009. * Fixing nbyte size in methods.c:memcpy * Adding a test * Re-adding removed newline * Shrinking the test array to save memory
…y#21067) Changing num to the number of bytes in the input array, PyArray_NBYTES(self). Solves numpy#21009. * Fixing nbyte size in methods.c:memcpy * Adding a test * Re-adding removed newline * Shrinking the test array to save memory
Describe the issue:
There is a
Segmentation fault
when unpickling an empty ndarray with a none-zero dimension.The first dimension
93049
may depend on the platform. If you cannot reproduce the error, please increase the first dimension.I think it has something to do with the page allocation.
Reproduce the code example:
Error message:
NumPy/Python version information:
1.22.1 3.8.11 (default, Aug 3 2021, 15:09:35)
[GCC 7.5.0]
The text was updated successfully, but these errors were encountered: