Skip to content
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

resize to empty array crashes #9216

Closed
juliantaylor opened this issue Jun 3, 2017 · 0 comments
Closed

resize to empty array crashes #9216

juliantaylor opened this issue Jun 3, 2017 · 0 comments

Comments

@juliantaylor
Copy link
Contributor

Resizing to an empty array crashes as it does not set the dimension to NULL as it should and allocates dimension memory with RENEW and not via the cache. The cache assumes all memory it receives has at least 16 bytes so when this empty pointer lands in the cache it causes out of bound errors.

for idx in range(200):
    print(idx)
    emptythingie = np.empty((1,))
    emptythingie.resize(())
juliantaylor added a commit to juliantaylor/numpy that referenced this issue Jun 3, 2017
0d arrays have NULL for stride and dimension, PyArray_Resize assigns
it a valid pointer from RENEW which when passed back to the allocation
cache does not have the minimum size of 16 bytes it requires leading to
out of bound accesses.

Closes numpygh-9216
charris pushed a commit to charris/numpy that referenced this issue Jun 17, 2017
0d arrays have NULL for stride and dimension, PyArray_Resize assigns
it a valid pointer from RENEW which when passed back to the allocation
cache does not have the minimum size of 16 bytes it requires leading to
out of bound accesses.

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

No branches or pull requests

1 participant