-
Notifications
You must be signed in to change notification settings - Fork 116
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] Crash in array creation with non-matching ranges #584
Comments
I'm not quite sure I see what the problem is. On the one hand, >>> np.array([range(0, 3), range(0, 5)])
<stdin>:1: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences
(which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated.
If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
array([range(0, 3), range(0, 5)], dtype=object) while on the other, a = np.array([range(0, 3),range(2**16, 2**26)]) is simply killed in my case: >>> np.array([range(0, 3), range(2**16, 2**26)])
Killed |
|
The second range is big enough that it exceeds the micropython heap and accessing beyond it has the happy side effect of crashing promptly. |
I tried to run your example in |
This is clearly wrong. Interestingly, it doesn't really matter what range you specify in the second range, the result is always a 3x2 matrix. |
Describe the bug
A clear and concise description of what the bug is. Give the
ulab
versionTo Reproduce
micropython will crash (segmentation fault in this case)
Expected behavior
An exception is raised. Here's the error that numpy raises, for reference:
Additional context
Found by fuzzing, not from real code
The text was updated successfully, but these errors were encountered: