peterstace / simplefeatures

Simple Features is a pure Go Implementation of the OpenGIS Simple Feature Access Specification
MIT License
129 stars 19 forks source link

Convex Hull Unit Test Crashing #356

Closed peterstace closed 3 years ago

peterstace commented 3 years ago

Note: this is on linux-aarch64, so possibly architecture dependent? It doesn't seem to occur on linux-amd64.

Stack trace:

--- FAIL: TestConvexHull (0.00s)
    --- FAIL: TestConvexHull/38 (0.00s)
        alg_convex_hull_test.go:199: input: POLYGON((0.9292893218813453 1.0707106781186548,1.1414213562373097 1,0.07071067811865475 -0.07071067811865475,0 -0.1414213562373095,0.9292893218813453 1.0707106781186548))
panic: runtime error: index out of range [-1] [recovered]
        panic: runtime error: index out of range [-1]

goroutine 7 [running]:
testing.tRunner.func1.2(0x1faa40, 0x400001a450)
        /usr/local/go/src/testing/testing.go:1144 +0x25c
testing.tRunner.func1(0x4000001680)
        /usr/local/go/src/testing/testing.go:1147 +0x38c
panic(0x1faa40, 0x400001a450)
        /usr/local/go/src/runtime/panic.go:965 +0x154
github.com/peterstace/simplefeatures/geom.(*pointStack).underTop(...)
        /home/petsta/go/src/github.com/peterstace/simplefeatures/geom/alg_convex_hull.go:134
github.com/peterstace/simplefeatures/geom.grahamScan(0x40001460a0, 0x6, 0x5, 0x5, 0x5, 0xfffffffe)
        /home/petsta/go/src/github.com/peterstace/simplefeatures/geom/alg_convex_hull.go:182 +0x590
github.com/peterstace/simplefeatures/geom.convexHull(0x3, 0x40000565c0, 0xaa, 0x3)
        /home/petsta/go/src/github.com/peterstace/simplefeatures/geom/alg_convex_hull.go:16 +0x70
github.com/peterstace/simplefeatures/geom.Geometry.ConvexHull(...)
        /home/petsta/go/src/github.com/peterstace/simplefeatures/geom/type_geometry.go:436
github.com/peterstace/simplefeatures/geom_test.TestConvexHull.func1(0x4000001680)
        /home/petsta/go/src/github.com/peterstace/simplefeatures/geom/alg_convex_hull_test.go:200 +0xbc
testing.tRunner(0x4000001680, 0x40000278d0)
        /usr/local/go/src/testing/testing.go:1194 +0xdc
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:1239 +0x244
FAIL    github.com/peterstace/simplefeatures/geom       0.004s
FAIL
peterstace commented 3 years ago

Closed via #357