-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: Segfault in trimesh's test suite with numpy 1.26.0b1 #24459
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
Comments
You can see
|
NumPy-only segfault reproducer on latest --- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -10043,3 +10043,8 @@ def test_gh_22683():
np.choose(np.zeros(10000, dtype=int), [a], out=a)
refc_end = sys.getrefcount(b)
assert refc_end - refc_start < 10
+
+
+def test_gh_24459():
+ a = np.zeros((50, 3), dtype=np.float64)
+ np.choose(a, [3, -1]) |
Segfault goes away if
At NumPy
The full suite passes on --- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -1119,7 +1119,6 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out,
return (PyObject *)obj;
fail:
- NPY_cast_info_xfree(&cast_info);
Py_XDECREF(multi);
for (i = 0; i < n; i++) {
Py_XDECREF(mps[i]);
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index 966b75cc1..2836c8985 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -10043,3 +10043,9 @@ def test_gh_22683():
np.choose(np.zeros(10000, dtype=int), [a], out=a)
refc_end = sys.getrefcount(b)
assert refc_end - refc_start < 10
+
+
+def test_gh_24459():
+ a = np.zeros((50, 3), dtype=np.float64)
+ with pytest.raises(TypeError):
+ np.choose(a, [3, -1]) Anyway, that's probably enough info to give Sebastian or Nathan a solid clue. For the record, I think the |
Oh yeah the trimesh cache fuzzing test has surfaced a number of bugs in numpy. By any chance is this bug also reproduced by my attempt to upstream that test in #24175 ? |
Thanks for the report @mgorny and test @tylerjereddy! With a debug build of numpy, I get:
Ah yes, the issue is that the PR incoming... |
Thanks a lot! I can confirm that I can no longer reproduce the crash with this patch applied. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue:
When running the test suite of trimesh package (as of 3.23.3) against numpy 1.26.0b1, I'm getting a segfault (details below). This problem doesn't occur with 1.25.2, so I suspect it might be a regression in the beta.
I've reproduced the problem with Python 3.10.12 and 3.11.4, using both numpy installed from wheels and built using Gentoo packages. The tracebacks below are done using the Gentoo package built with
-O0 -ggdb
.CC @mikedh
Reproduce the code example:
Error message:
Runtime information:
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: