Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMPTY crashes ST_Intersects #30

Open
cuteDen-ECNU opened this issue Nov 29, 2023 · 1 comment
Open

EMPTY crashes ST_Intersects #30

cuteDen-ECNU opened this issue Nov 29, 2023 · 1 comment

Comments

@cuteDen-ECNU
Copy link
Owner

cuteDen-ECNU commented Nov 29, 2023

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"

@cuteDen-ECNU cuteDen-ECNU changed the title EMPTY crashes ST_Intersects using JOIN EMPTY crashes ST_Intersects Nov 29, 2023
@cuteDen-ECNU
Copy link
Owner Author

cuteDen-ECNU commented Nov 29, 2023

bugtracker link: https://trac.osgeo.org/postgis/ticket/5627
fix link: e85cd10
reproduce: 6db0564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant