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

[BUG] crash in (arg)min (and probably (arg)max) #586

Open
jepler opened this issue Jan 24, 2023 · 1 comment
Open

[BUG] crash in (arg)min (and probably (arg)max) #586

jepler opened this issue Jan 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jepler
Copy link
Collaborator

jepler commented Jan 24, 2023

Describe the bug
A clear and concise description of what the bug is. Give the ulab version

MicroPython v1.19.1-837-g67fac4ebc on 2023-01-24; linux [GCC 4.2.1] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> from lab import numpy as np
>>> a=np.array([range(200000)])
>>> np.min(a, axis=1)
Segmentation fault

Expected behavior
python3 and numpy give:

>>> np.min(_, axis=1)
array([0])

Additional context
Found by automated fuzzing

@jepler jepler added the bug Something isn't working label Jan 24, 2023
@v923z
Copy link
Owner

v923z commented Jan 25, 2023

While this is still incorrect

>>> np.min(np.array([range(5)]), axis=1)
0.0

it, at least, doesn't segfault. So, are we dealing with a problem here that is much deeper than ulab? If I simply create the array from the range, then

>>> np.array([range(200000)])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 1600000 bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants