Opened 5 months ago

Closed 5 months ago

#5629 closed defect (fixed)

ST_RemoveRepeatedPoints crash on MULTIPOINT with empty coordinate

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 3.1.11
Component: postgis Version: 3.4.x
Keywords: Cc:

Description (last modified by robe)

SELECT ST_RemoveRepeatedPoints('MULTIPOINT(EMPTY,2 1,2 4, 4 5)'::geometry, 20.1);

Tested on

POSTGIS="3.5.0dev 3.4.0rc1-818-g6c2e935b6" [EXTENSION] PGSQL="160" GEOS="3.12.1-CAPI-1.18.1" (compiled against GEOS 3.13.0) 

Change History (3)

comment:1 by robe, 5 months ago

Description: modified (diff)

backtrace

#18 0x00000000007efe3a in pg_plan_query (querytree=0x7a5f3e8,
    query_string=0x7a5e368 "SELECT ST_RemoveRepeatedPoints('MULTIPOINT(EMPTY,2 1,2 4, 4 5)'::geometry, 20.1);", cursorOptions=2048, boundParams=0x0)
    at postgres.c:904
#19 0x00000000007eff41 in pg_plan_queries (querytrees=0x877d7c8,
    query_string=query_string@entry=0x7a5e368 "SELECT ST_RemoveRepeatedPoints('MULTIPOINT(EMPTY,2 1,2 4, 4 5)'::geometry, 20.1);",
    cursorOptions=cursorOptions@entry=2048, boundParams=boundParams@entry=0x0)
    at postgres.c:996
#20 0x00000000007f02c5 in exec_simple_query (
    query_string=0x7a5e368 "SELECT ST_RemoveRepeatedPoints('MULTIPOINT(EMPTY,2 1,2 4, 4 5)'::geometry, 20.1);") at postgres.c:1193
#21 0x00000000007f4f05 in PostgresMain (dbname=0x79c8758 "postgis_garden_35",
    username=0x1f8fb8 "postgres") at postgres.c:4637
#22 0x00000000007523f2 in BackendRun (port=0x52df7c0, port=0x52df7c0)
    at postmaster.c:4464
#23 SubPostmasterMain (argc=argc@entry=3, argv=argv@entry=0x1f6f90)
    at postmaster.c:4960
#24 0x00000000009b3944 in main (argc=3, argv=0x1f6f90) at main.c:190
(gdb) cont
Continuing.

Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000006c5aa13b in cmp_point_y (pa=0x7a66470, pb=0x7a66468)
    at lwgeom.c:1590
1590            return (pt1->y > pt2->y) ? 1 : ((pt1->y < pt2->y) ? -1 : 0);

comment:2 by robe, 5 months ago

Milestone: PostGIS 3.4.2PostGIS 3.1.11

comment:3 by pramsey, 5 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.