[postgis-tickets] [PostGIS] #4144: When ANALYZE a table that contains certains values on a geometry field, PostgreSQL crash (was: If during writing tables that contains PostGIS geometry fields AUTOVACUUM is launched, it crashes and force PostgreSQL to restart.)

PostGIS trac at osgeo.org
Tue Aug 21 05:14:30 PDT 2018


#4144: When ANALYZE a table that contains certains values on a geometry field,
PostgreSQL crash
----------------------+---------------------------
  Reporter:  zancos   |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  blocker  |  Milestone:  PostGIS 2.4.5
 Component:  postgis  |    Version:  2.4.x
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by zancos):

 Issue edited.

 Trigger: when in a geometry field is pushed a GEOMETRYCOLLECTION with more
 than two points, and one of these points has, at least, one value
 containing a number smaller than -3.385894e+38 (which is not the limit)
 and then if ANALYSE the table, PostgreSQL crash and force the database
 engine to restart.

 Due to ANALYSE is executed before vacuum tables when autovacuum is called,
 also PostgreSQL crash when inserting values into database and at least
 there is one of this fields filled in with this "problematic" value.

 This code reproduce the error:

 {{{
 -- ----------------------------
 -- Prepare schema and populate postgis extension
 -- ----------------------------
 CREATE SCHEMA bug_schema;
 CREATE EXTENSION postgis SCHEMA bug_schema;

 -- ----------------------------
 -- Table structure for scan
 -- ----------------------------
 DROP TABLE IF EXISTS bug_schema.bug_table;
 CREATE TABLE bug_schema.bug_table (
   "geometryField" bug_schema."geometry" NOT NULL DEFAULT NULL
 )
 ;

 PREPARE stmt AS INSERT INTO bug_schema.bug_table ("geometryField") VALUES
 ($1);
 EXECUTE stmt ('GEOMETRYCOLLECTION(POINT(-3.385894e+38 0 0),POINT(0 0
 0))');
 DEALLOCATE stmt;

 ANALYZE;
 }}}

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