[PostGIS] #5627: Empty crashes ST_Intersects
PostGIS
trac at osgeo.org
Wed Nov 29 06:57:26 PST 2023
#5627: Empty crashes ST_Intersects
----------------------+---------------------------
Reporter: wenjing | Owner: pramsey
Type: defect | Status: new
Priority: critical | Milestone: PostGIS 3.4.2
Component: postgis | Version: 3.4.x
Keywords: |
----------------------+---------------------------
The following statement crashes PostGIS:
{{{
DROP TABLE IF EXISTS t;
CREATE TABLE t (id int, geom geometry);
INSERT INTO t (id, geom) VALUES (1,ST_GeomFromText('MULTIPOLYGON(((-357
477,-392 574,-378 574,-357 477)))'));
INSERT INTO t (id, geom) VALUES (2,ST_GeomFromText('MULTIPOINT(EMPTY,(-378
574),(-357 477))'));
SELECT COUNT(*) FROM t As a1 , t As a2 WHERE ST_Intersects(a1.geom,
a2.geom) and a1.id <> a2.id;
-- psql:script/simplify.sql:32: NOTICE: lwgeom_api.c [352] called with
n=0 and npoints=0
-- psql:script/simplify.sql:32: server closed the connection unexpectedly
-- This probably means the server terminated abnormally
-- before or while processing the request.
-- psql:script/simplify.sql:32: error: connection to server was lost
}}}
The stack information:
{{{
#0 0x00007fa09c479141 in point_in_ring_rtree (root=0x55ea670db450,
point=0x0) at lwgeom_rtree.c:515
#1 0x00007fa09c4793c4 in point_in_multipolygon_rtree
(root=0x55ea670db1d8, polyCount=1,
ringCounts=0x55ea670db1c8, point=0x55ea66d521c8) at lwgeom_rtree.c:602
#2 0x00007fa09c4794df in pip_short_circuit (poly_cache=0x55ea670db1a0,
point=0x55ea66d521c8,
gpoly=0x55ea66d520f0) at lwgeom_rtree.c:658
#3 0x00007fa09c464787 in ST_Intersects (fcinfo=0x55ea670d8d30) at
lwgeom_geos.c:2382
#4 0x000055ea65d530b0 in ExecInterpExpr ()
#5 0x000055ea65d839bc in ExecNestLoop ()
#6 0x000055ea65d662b1 in fetch_input_tuple ()
#7 0x000055ea65d693b3 in ExecAgg ()
#8 0x000055ea65d568e2 in standard_ExecutorRun ()
#9 0x000055ea65ef201f in PortalRunSelect ()
#10 0x000055ea65ef3403 in PortalRun ()
#11 0x000055ea65eef8dd in exec_simple_query ()
#12 0x000055ea65ef1c25 in PostgresMain ()
#13 0x000055ea65e6bdbe in ServerLoop ()
#14 0x000055ea65e6cd0c in PostmasterMain ()
#15 0x000055ea65bbeba1 in main ()
}}}
The version is the newest on GitHub:
{{{
POSTGIS="3.5.0dev 3.4.0rc1-818-g6c2e935b6" [EXTENSION] PGSQL="170"
GEOS="3.13.0dev-CAPI-1.18.0" PROJ="8.2.1
NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org
USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/
share/proj/proj.db" LIBXML="2.9.13"
}}}
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5627>
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