[postgis-tickets] [PostGIS] #4776: st_geometrytype causes 100% CPU loop in postgres13 on specific linestring

PostGIS trac at osgeo.org
Wed Oct 28 04:44:36 PDT 2020


#4776: st_geometrytype causes 100% CPU loop in postgres13 on specific linestring
------------------------+---------------------------
 Reporter:  tvijlbrief  |      Owner:  pramsey
     Type:  defect      |     Status:  new
 Priority:  medium      |  Milestone:  PostGIS 3.1.0
Component:  postgis     |    Version:  3.0.x
 Keywords:              |
------------------------+---------------------------
 I have a dataset which works fine with postgres12/postgis3.0.2 but a
 specific valid large linestring causes st_geometrytype() to hang:

 =====demo13.sh fragment======================

 create table demo(wkb_geometry geometry(Geometry,28992));

 COPY demo (wkb_geometry) FROM stdin;
 0102000020  data skipped (see attached for full script)

 \.

 select st_isvalid(wkb_geometry) from demo;

 select ST_numpoints(wkb_geometry) from demo;

 -- Next statement will hang Postgres13 server in 100% CPU loop:

 select ST_GeometryType(wkb_geometry) from demo;


 =============================================

 Output from script:

 DROP TABLE
 CREATE TABLE
 COPY 1
  st_isvalid
 ------------
  t
 (1 row)

  st_numpoints
 --------------
          1518
 (1 row)

 Script/server hangs....

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