[postgis-tickets] [PostGIS] #5586: Crash bug when using ST_Intersects

PostGIS trac at osgeo.org
Mon Oct 23 01:55:35 PDT 2023


#5586: Crash bug when using ST_Intersects
-----------------------+---------------------------
  Reporter:  Wenjing   |      Owner:  pramsey
      Type:  defect    |     Status:  new
  Priority:  critical  |  Milestone:  PostGIS 3.4.1
 Component:  postgis   |    Version:  3.4.x
Resolution:            |   Keywords:
-----------------------+---------------------------
Description changed by Wenjing:

Old description:

> {{{
> DROP TABLE IF EXISTS t;
> CREATE TABLE t (geom geometry);
> INSERT INTO t (geom) VALUES ((ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0
> 0),LINESTRING(0 0,1 0))')));
> INSERT INTO t (geom) SELECT ST_Boundary(t.geom) FROM t;
> SELECT * FROM t As a1 JOIN t As a2 ON ST_Intersects(a1.geom, a2.geom);
>
> ERROR INFO:
> -- psql:script/simplify.sql:7: server closed the connection unexpectedly
> -- This probably means the server terminated abnormally
> -- before or while processing the request.
> -- psql:script/simplify.sql:7: error: connection to server was lost
> }}}
>
> It could be ST_Boundary makes the boundary of POINT(0 0) be 'EMPTY'
> instead of POINT EMPTY, resulting in this crash.

New description:

 {{{
 DROP TABLE IF EXISTS t;
 CREATE TABLE t (geom geometry);
 INSERT INTO t (geom) VALUES ((ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0
 0),LINESTRING(0 0,1 0))')));
 INSERT INTO t (geom) SELECT ST_Boundary(t.geom) FROM t;
 SELECT * FROM t As a1 JOIN t As a2 ON ST_Intersects(a1.geom, a2.geom);

 }}}
 stack trace:

 {{{
 Program received signal SIGSEGV, Segmentation fault.
 0x00007fc000d0cf4c in ?? () from /lib/x86_64-linux-gnu/libgeos.so.3.10.2
 (gdb) bt
 #0  0x00007fc000d0cf4c in ?? () from /lib/x86_64-linux-
 gnu/libgeos.so.3.10.2
 #1  0x00007fc000d34f22 in
 geos::algorithm::PointLocator::computeLocation(geos::geom::Coordinate
 const&, geos::geom::Geometry const*) () from /lib/x86_64-linux-
 gnu/libgeos.so.3.10.2
 #2  0x00007fc000d35078 in
 geos::algorithm::PointLocator::computeLocation(geos::geom::Coordinate
 const&, geos::geom::Geometry const*) () from /lib/x86_64-linux-
 gnu/libgeos.so.3.10.2
 #3  0x00007fc000d35209 in
 geos::algorithm::PointLocator::locate(geos::geom::Coordinate const&,
 geos::geom::Geometry const*) () from /lib/x86_64-linux-
 gnu/libgeos.so.3.10.2
 #4  0x00007fc000d53aed in
 geos::geom::prep::BasicPreparedGeometry::isAnyTargetComponentInTest(geos::geom::Geometry
 const*) const () from /lib/x86_64-linux-gnu/libgeos.so.3.10.2
 #5  0x00007fc00142c15c in GEOSPreparedIntersects_r () from /lib/x86_64
 -linux-gnu/libgeos_c.so.1
 #6  0x00007fc001488f74 in ST_Intersects (fcinfo=0x55d8585cbaf0) at
 lwgeom_geos.c:2458
 #7  0x000055d8577d57e2 in ExecInterpExpr (state=0x55d8585cb618,
 econtext=0x55d8585ca580, isnull=0x7ffd0c310a6f)
     at execExprInterp.c:758
 #8  0x000055d85782ad25 in ExecEvalExprSwitchContext (state=0x55d8585cb618,
 econtext=0x55d8585ca580,
     isNull=0x7ffd0c310a6f) at ../../../src/include/executor/executor.h:355
 #9  0x000055d85782ae24 in ExecQual (state=0x55d8585cb618,
 econtext=0x55d8585ca580)
     at ../../../src/include/executor/executor.h:424
 #10 0x000055d85782b15c in ExecNestLoop (pstate=0x55d8585ca478) at
 nodeNestloop.c:214
 #11 0x000055d8577e13c3 in ExecProcNode (node=0x55d8585ca478) at
 ../../../src/include/executor/executor.h:273
 #12 0x000055d8577e3cf0 in ExecutePlan (estate=0x55d8585ca248,
 planstate=0x55d8585ca478, use_parallel_mode=false,
     operation=CMD_SELECT, sendTuples=true, numberTuples=0,
 direction=ForwardScanDirection, dest=0x55d85899c1f0,
     execute_once=true) at execMain.c:1670
 --Type <RET> for more, q to quit, c to continue without paging--
 #13 0x000055d8577e1957 in standard_ExecutorRun (queryDesc=0x55d8589949c8,
 direction=ForwardScanDirection, count=0,
     execute_once=true) at execMain.c:365
 #14 0x000055d8577e17de in ExecutorRun (queryDesc=0x55d8589949c8,
 direction=ForwardScanDirection, count=0,
     execute_once=true) at execMain.c:309
 #15 0x000055d857a69ce0 in PortalRunSelect (portal=0x55d8585758c8,
 forward=true, count=0, dest=0x55d85899c1f0)
     at pquery.c:924
 #16 0x000055d857a69942 in PortalRun (portal=0x55d8585758c8,
 count=9223372036854775807, isTopLevel=true,
     run_once=true, dest=0x55d85899c1f0, altdest=0x55d85899c1f0,
 qc=0x7ffd0c310ea0) at pquery.c:768
 #17 0x000055d857a62d1b in exec_simple_query (
     query_string=0x55d8584f5ea8 "SELECT * FROM t As a1 JOIN t As a2 ON
 ST_Intersects(a1.geom, a2.geom);")
     at postgres.c:1273
 #18 0x000055d857a67a2b in PostgresMain (dbname=0x55d85852f868 "postgres",
 username=0x55d85852f850 "postgres")
     at postgres.c:4657
 #19 0x000055d8579a003f in BackendRun (port=0x55d8585223a0) at
 postmaster.c:4423
 #20 0x000055d85799f684 in BackendStartup (port=0x55d8585223a0) at
 postmaster.c:4108
 #21 0x000055d85799c00d in ServerLoop () at postmaster.c:1767
 #22 0x000055d85799b90f in PostmasterMain (argc=3, argv=0x55d8584ef7a0) at
 postmaster.c:1466
 #23 0x000055d85786019b in main (argc=3, argv=0x55d8584ef7a0) at main.c:198
 }}}

--
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5586#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list