Opened 3 months ago

Closed 2 months ago

Last modified 5 weeks ago

#5240 closed defect (fixed)

ST_DumpPoints and ST_DumpSegments crash with multipolygon that includes an empty polygon

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 2.5.9
Component: postgis Version: 3.2.x
Keywords: Cc:

Description (last modified by robe)

SELECT ST_DumpPoints(foo1.the_geom)  As result
	FROM (
			SELECT ST_GeomFromText('MULTIPOLYGON (((9 9, 9 1, 1 1, 2 4, 7 7, 9 9)), EMPTY)', 4326) As the_geom ) As foo1;

This I tested on 3.2.4dev, but haven't tested others to see how far back is the issue.

Change History (9)

comment:1 by robe, 3 months ago

Description: modified (diff)
Milestone: PostGIS 3.2.4PostGIS 3.0.8
Summary: ST_DumpPoints crash with multipolygon that includes an empty polygonST_DumpPoints and ST_DumpSegments crash with multipolygon that includes an empty polygon
SELECT ST_DumpSegments(foo1.the_geom)  As result
							FROM (
		(SELECT ST_GeomFromText('MULTIPOLYGON (((9 9, 9 1, 1 1, 2 4, 7 7, 9 9)), EMPTY)', 4326) As the_geom ) ) As foo1 LIMIT 10;

I'm going to assume these issues have been here for a while.

comment:2 by robe, 2 months ago

Owner: changed from pramsey to robe

Stack trace:

0x00000000711a19a0 in LWGEOM_dumppoints (fcinfo=0x74c1f48)
    at lwgeom_dumppoints.c:190
warning: Source file is more recent than executable.
190                                             if (state->pt == poly->rings[state->ring]->npoints) {
(gdb) bt
#0  0x00000000711a19a0 in LWGEOM_dumppoints (fcinfo=0x74c1f48)
    at lwgeom_dumppoints.c:190
#1  0x00000000005e574a in ExecMakeFunctionResultSet (fcache=0x74c1800,
    econtext=econtext@entry=0x74c0d38, argContext=0x7e05250,
    isNull=0x74c1750, isDone=isDone@entry=0x74c17e0) at execSRF.c:606
#2  0x0000000000607180 in ExecProjectSRF (node=node@entry=0x74c0c20,
    continuing=continuing@entry=true) at nodeProjectSet.c:175
#3  0x00000000006072ad in ExecProjectSet (pstate=0x74c0c20)
    at nodeProjectSet.c:69
#4  0x00000000005db31a in ExecProcNode (node=0x74c0c20)
    at ../../../src/include/executor/executor.h:239
#5  ExecutePlan (execute_once=<optimized out>, dest=0x88cb468,
    direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>,
    operation=CMD_SELECT, use_parallel_mode=<optimized out>,
    planstate=0x74c0c20, estate=0x74c09b8) at execMain.c:1646
#6  standard_ExecutorRun (queryDesc=0x89300e8, direction=<optimized out>,
    count=0, execute_once=<optimized out>) at execMain.c:364
#7  0x000000000075658b in PortalRunSelect (portal=0x745c4a8,
    portal@entry=0x0, forward=forward@entry=true, count=0,
    count@entry=143438952, dest=dest@entry=0x4b0ef68) at pquery.c:929
#8  0x0000000000757d4f in PortalRun (portal=0x0, portal@entry=0x745c4a8,
    count=143438952, count@entry=2147483647,
    isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true,
    dest=<optimized out>, dest@entry=0x88cb468,
    altdest=altdest@entry=0x88cb468,
    completionTag=completionTag@entry=0x4b0ef20 "") at pquery.c:770
#9  0x0000000000753530 in exec_simple_query (
    query_string=0x74940f8 "SELECT ST_DumpPoints(foo1.the_geom)  As result\n\tFROM (\n\t\t\tSELECT ST_GeomFromText('MULTIPOLYGON (((9 9, 9 1, 1 1, 2 4, 7 7, 9 9)), EMPTY)', 4326) As the_geom ) As foo1;") at postgres.c:1215
#10 0x0000000000754eb1 in PostgresMain (argc=<optimized out>,
    argv=argv@entry=0x7424848, dbname=<optimized out>,
    username=<optimized out>) at postgres.c:4247
#11 0x00000000006d02f4 in BackendRun (port=0x4b0f3b0, port=0x4b0f3b0)
    at postmaster.c:4437
#12 SubPostmasterMain (argc=argc@entry=3, argv=argv@entry=0x1e6c10)
    at postmaster.c:4959
#13 0x00000000008dd3aa in main (argc=3, argv=0x1e6c10) at main.c:205

comment:3 by Regina Obe <lr@…>, 2 months ago

In db9ec5fe/git:

ST_DumpPoints and ST_DumpSegments crash on multipolygon
with empty polygon
References #5240 for PostGIS 3.4.0dev

comment:4 by Regina Obe <lr@…>, 2 months ago

In 8ac4b09/git:

ST_DumpPoints and ST_DumpSegments crash on multipolygon
with empty polygon
References #5240 for PostGIS 3.3.2

comment:5 by Regina Obe <lr@…>, 2 months ago

In ef33207/git:

ST_DumpPoints and ST_DumpSegments crash on multipolygon
with empty polygon
References #5240 for PostGIS 3.2.4

comment:6 by Regina Obe <lr@…>, 2 months ago

In 702b824/git:

Correction to previous commit References #5240

Real code commit at [eb992fb157/git] for PostGIS 3.1.8

Last edited 2 months ago by robe (previous) (diff)

comment:7 by Regina Obe <lr@…>, 2 months ago

Resolution: fixed
Status: newclosed

In dc920869/git:

ST_DumpPoints crash with empty polygon
Closes #5240 for PostGIS 3.0.8

comment:8 by Regina Obe <lr@…>, 5 weeks ago

In 612a7e5/git:

ST_DumpPoints crash with empty polygon
Closes #5240 for PostGIS 2.5.9

comment:9 by robe, 5 weeks ago

Milestone: PostGIS 3.0.8PostGIS 2.5.9
Note: See TracTickets for help on using tickets.