[PostGIS] #5629: ST_RemoveRepeatedPoints crash on MULTIPOINT with empty coordinate

PostGIS trac at osgeo.org
Wed Nov 29 17:33:08 PST 2023


#5629: ST_RemoveRepeatedPoints crash on MULTIPOINT with empty coordinate
----------------------+---------------------------
  Reporter:  robe     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.4.2
 Component:  postgis  |    Version:  3.4.x
Resolution:           |   Keywords:
----------------------+---------------------------

Old description:

> {{{
> 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)
> }}}

New description:

 {{{
 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)
 }}}

--
Comment (by robe):

 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 at entry=0x7a5e368 "SELECT
 ST_RemoveRepeatedPoints('MULTIPOINT(EMPTY,2 1,2 4, 4 5)'::geometry,
 20.1);",
     cursorOptions=cursorOptions at entry=2048,
 boundParams=boundParams at 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 at entry=3, argv=argv at 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);

 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5629#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