Skip to content

BUG: Delaunay/qhull segfault on self-pass #21286

@tylerjereddy

Description

@tylerjereddy

I noticed this segfault on main while investigating gh-21279. python dev.py test -- -k "test_find_simplex_self_segfault". It is clearly an abuse of the call signature but we generally should intercept before segfaulting.

--- a/scipy/spatial/tests/test_qhull.py
+++ b/scipy/spatial/tests/test_qhull.py
@@ -194,6 +194,12 @@ class TestUtilities:
             j = qhull.tsearch(tri, p[:2])
             assert_equal(i, j)
 
+    def test_find_simplex_self_segfault(self):
+        # segfaults before bug fix
+        points2d = np.array([[0, 0], [0, 1.1], [1, 0], [1, 1]])
+        tri = qhull.Delaunay(points2d)
+        tri.find_simplex(tri)
+
     def test_plane_distance(self):
         # Compare plane distance from hyperplane equations obtained from Qhull
         # to manually computed plane equations

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.spatial

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions