[geos-devel] [GEOS] #1047: GEOS Panics on GeometryCollection with 1 MultiPolygon object

GEOS geos-trac at osgeo.org
Sat Aug 22 09:02:34 PDT 2020


#1047: GEOS Panics on GeometryCollection with 1 MultiPolygon object
------------------------+--------------------------
 Reporter:  otan        |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  Default     |    Version:  3.8.0
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 Tested on v3.8.1.

 The following code will seg fault:

 {{{
 #include <geos_c.h>
 #include <string>

 using namespace std;

 void geos_message_handler(const char *fmt, ...) {}
 void geos_error_handler(const char *fmt, ...) {}

 int main() {
   string aEWKB =
 "01020000000200000000000000000000000000000000000000000000000000F03F0000000000000000";
   string bEWKB =
 "0107000000010000000106000000010000000103000000010000000500000008690b3a70a9c347540a11d15993eec7e04b9e4d8fd2cb4702907c2929abe847d02aef5652e3cec72c1b57867da3dd47bbf47698d501eac7ccc0d287b380d44708690b3a70a9c347540a11d15993eec7";

   initGEOS(&geos_message_handler, &geos_error_handler);

   auto wkbReader = GEOSWKBReader_create();
   auto geomA = GEOSWKBReader_read(wkbReader, reinterpret_cast<const
 unsigned char*>(aEWKB.data()), aEWKB.length());
   auto geomB = GEOSWKBReader_read(wkbReader, reinterpret_cast<const
 unsigned char*>(bEWKB.data()), bEWKB.length());
   GEOSIntersects(geomA, geomB);
   return 0;
 }
 }}}

 Seems like geometryN does not work and returns NULL:


 {{{
 _ZN4geos9algorithm6locate24SimplePointInAreaLocator20locatePointInPolygonERKNS_4geom10CoordinateEPKNS3_7PolygonE
 /Users/otan/go/src/github.com/cockroachdb/cockroach/lib/libgeos.dylib:0
 pc=0x14218db3
 _ZN4geos9geomgraph11EdgeEndStar11getLocationEiRKNS_4geom10CoordinateEPNSt3__16vectorIPNS0_13GeometryGraphENS6_9allocatorIS9_EEEE
 /Users/otan/go/src/github.com/cockroachdb/cockroach/lib/libgeos.dylib:0
 pc=0x1423fce8
 _ZN4geos9geomgraph11EdgeEndStar16computeLabellingEPNSt3__16vectorIPNS0_13GeometryGraphENS2_9allocatorIS5_EEEE
 /Users/otan/go/src/github.com/cockroachdb/cockroach/lib/libgeos.dylib:0
 pc=0x1423f936
 _ZN4geos9operation6relate14RelateComputer9computeIMEv
 /Users/otan/go/src/github.com/cockroachdb/cockroach/lib/libgeos.dylib:0
 pc=0x142a95a3
 _ZN4geos9operation6relate8RelateOp6relateEPKNS_4geom8GeometryES6_
 /Users/otan/go/src/github.com/cockroachdb/cockroach/lib/libgeos.dylib:0
 pc=0x142ab1f2
 _ZNK4geos4geom8Geometry10intersectsEPKS1_
 /Users/otan/go/src/github.com/cockroachdb/cockroach/lib/libgeos.dylib:0
 pc=0x14220773
 GEOSIntersects_r
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/geos/ticket/1047>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list