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

Assigning large object array to bool-specified slice of float array crashes Python #7666

Closed
acdr000 opened this issue May 24, 2016 · 1 comment · Fixed by #7669
Closed

Assigning large object array to bool-specified slice of float array crashes Python #7666

acdr000 opened this issue May 24, 2016 · 1 comment · Fixed by #7669

Comments

@acdr000
Copy link

acdr000 commented May 24, 2016

Running Python 2.7.10, numpy 1.9.2, Windows 7, 64-bit AMD processor.
I'll let code do the talking:

Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> f_arr = np.zeros((1000,))
>>> o_arr = np.ones((100,), dtype=object)
>>> b_arr = np.zeros((1000,), dtype=bool)
>>> b_arr[:100] = True
>>> f_arr[b_arr] = o_arr

This last line is supposed to set the first 100 elements of f_arr to 1. Instead, it crashes Python. This does not crash for significantly smaller arrays. I unfortunately cannot debug the underlying numpy code.

@seberg
Copy link
Member

seberg commented May 24, 2016

Found the bug, simple thing of the iterator not needing api, but the transfer function needing it.

seberg added a commit to seberg/numpy that referenced this issue May 24, 2016
This caused bugs when the iteration does not need the API, but
the data copy does.

closes numpygh-7666
charris pushed a commit to charris/numpy that referenced this issue May 24, 2016
This caused bugs when the iteration does not need the API, but
the data copy does.

closes numpygh-7666
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

Successfully merging a pull request may close this issue.

2 participants