-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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: scipy.spatial.Delaunay, scipy.interpolate.LinearNDInterpolator segfault on invalid shapes #20623
Comments
This issue is not related to #20619, since it is not related to concurrency. However, I can reproduce it, which implies that some other kind of error is occurring, I can further investigate this one. |
* Deals with the `spatial` part of scipygh-20623 (`Voronoi` was also affected beyond the originally-reported `Delaunay` segfault). * Both classes are documented to accept arrays with two dimensions only, so raise a `ValueError` in cases with other dimensions to avoid the segfault. * Other potential points of confusion here are the differences between arrays with two dimensions and two dimensional arrays that represent generators with more than two dimensions via the number of columns, but this is just how things are for most array programming languages of course. Also, the docs don't explicitly say array-like for the generators I don't think, but this patch only worked if I placed it after the coercion to array type. [skip circle]
As the cross-linked PR indicates, we just need to error out for the |
In the scipy/scipy/interpolate/interpnd.pyx Lines 329 to 330 in 4a537b7
In the latest code, I have confirmed that using the code reported in this issue does not cause a segmentation fault, thanks to the validation introduced in PR #20633:
So, I think we can close this issue. |
* Deals with the `spatial` part of scipygh-20623 (`Voronoi` was also affected beyond the originally-reported `Delaunay` segfault). * Both classes are documented to accept arrays with two dimensions only, so raise a `ValueError` in cases with other dimensions to avoid the segfault. * Other potential points of confusion here are the differences between arrays with two dimensions and two dimensional arrays that represent generators with more than two dimensions via the number of columns, but this is just how things are for most array programming languages of course. Also, the docs don't explicitly say array-like for the generators I don't think, but this patch only worked if I placed it after the coercion to array type. [skip circle] [skip ci] [ci skip]
Describe your issue.
scipy.spatial.Delaunay
andscipy.interpolate.LinearNDInterpolator
segfault on inputs of invalid shapes.Reproducing Code Example
or
Error message
SciPy/NumPy/Python version and system information
The text was updated successfully, but these errors were encountered: