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] Segfault or wrong value on array with non-vanilla strides. #381

Open
lusewell opened this issue Jun 1, 2021 · 1 comment
Open
Assignees
Labels

Comments

@lusewell
Copy link

lusewell commented Jun 1, 2021

Describe the bug
Segfault or wrong answer when running various functions on a numpy array with unusual strides. Looks like reading outside the array.

To Reproduce

import bottleneck
import numpy as np
data = np.zeros((1,500, 2)).transpose(1,2,0)
bottleneck.nanmax(data) # This inconsistently either segfaults or gives a non-zero very large number.

bottleneck = 1.3.2
numpy = 1.16.6
python = 3.7.7

Operating system is RHEL7.

I've also replicated on ubuntu with python 3.9 and numpy 1.20, (still bottleneck 1.3.2) so doesn't seem to be too sensitive to versions of other packages.

Expected behavior
The nanmax of this data should always be zero.

Additional context
This in turn breaks xarray.DataArray.max

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

No branches or pull requests

2 participants