[postgis-tickets] [PostGIS] #2985: server crash when analyzing small tables

PostGIS trac at osgeo.org
Sat Sep 24 00:17:33 PDT 2016


#2985: server crash when analyzing small tables
-----------------------+------------------------------------------
  Reporter:  nkiraly   |      Owner:  pramsey
      Type:  defect    |     Status:  closed
  Priority:  critical  |  Milestone:  PostGIS 2.2.3
 Component:  postgis   |    Version:  2.2.x
Resolution:  fixed     |   Keywords:  analyze server crash freebsd
-----------------------+------------------------------------------
Changes (by robe):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 Now that I got all my compile issues squared aware, I tried this exercise
 a couple of times on the same PostgresQL 9.3 freebsd server.


 {{{
 create table test (a integer not null, g geometry);
  insert into test values (1,
 '0102000020E6100000010000006D1092A47FF33440AD4ECD9B00334A40');
 vacuum FULL ANALYZE VERBOSE test;
 }}}


 Conclusion - PostGIS 2.1.7 consistently crashes, it's impressive how
 faithful it is at crashing.


 {{{
 SELECT postgis_full_version() || ' ' || version();
 ?column?
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  POSTGIS="2.1.7 r13414" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08
 September 2015" LIBXML="2.9.4" LIBJSON="UNKNOWN" PostgreSQL 9.3.14 on
 amd64-portbld-freebsd10.1, compiled by FreeBSD clang version 3.4.1
 (tags/RELEASE_34/dot1-final 208032) 20140512, 64-bit
 (1 row)


 postgis21=# create table test (a integer not null, g geometry);
 nsert iERROR:  relation "test" already exists
 postgis21=#  insert into test values (1,
 '0102000020E6100000010000006D1092A47FF33440AD4ECD9B00334A40');
 ALYZE VERBOSE test;INSERT 0 1
 postgis21=# vacuum FULL ANALYZE VERBOSE test;
 INFO:  vacuuming "public.test"
 INFO:  "test": found 0 removable, 2 nonremovable row versions in 1 pages
 DETAIL:  0 dead row versions cannot be removed yet.
 CPU 0.00s/0.00u sec elapsed 0.00 sec.
 INFO:  analyzing "public.test"
 INFO:  "test": scanned 1 of 1 pages, containing 2 live rows and 0 dead
 rows; 2 rows in sample, 2 estimated total rows
 server closed the connection unexpectedly
         This probably means the server terminated abnormally
         before or while processing the request.
 The connection to the server was lost. Attempting reset: Failed.

 }}}


 Went and compiled my own PostGIS 2.3.0rc1 (appyling Greg's patch to the
 tar ball to do so and patch from #3639) I can do CREATE EXTENSION now.


 {{{
 SELECT postgis_full_version() || ' ' || version();
 ?column?
 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  POSTGIS="2.3.0rc1 r15121" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2,
 08 September 2015" GDAL="GDAL 2.1.0, released 2016/04/25" LIBXML="2.9.4"
 LIBJSON="0.12" RASTER PostgreSQL 9.3.14 on amd64-portbld-freebsd10.1,
 compiled by FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final
 208032) 20140512, 64-bit
 (1 row)

 postgis23rc1=#  insert into test values (1,
 '0102000020E6100000010000006D1092A47FF33440AD4ECD9B00334A40');
 INSERT 0 1
 postgis23rc1=# vacuum FULL ANALYZE VERBOSE test;
 INFO:  vacuuming "public.test"
 INFO:  "test": found 0 removable, 1 nonremovable row versions in 1 pages
 DETAIL:  0 dead row versions cannot be removed yet.
 CPU 0.00s/0.00u sec elapsed 0.00 sec.
 INFO:  analyzing "public.test"
 INFO:  "test": scanned 1 of 1 pages, containing 1 live rows and 0 dead
 rows; 1 rows in sample, 1 estimated total rows
 VACUUM
 }}}


 -- compiled by own PostGIS 2.2.2, again applying Greg's patch from #3604
 (cause I couldn't compile without it)
 -- no crash

 {{{
 postgis222=# create extension postgis version "2.2.2";
 CREATE EXTENSION
 postgis222=# select postgis_full_version() || ' ' || version();
 ?column?
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  POSTGIS="2.2.2 r14797" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08
 September 2015" GDAL="GDAL 2.1.0, released 2016/04/25" LIBXML="2.9.4"
 LIBJSON="0.12" RASTER PostgreSQL 9.3.14 on amd64-portbld-freebsd10.1,
 compiled by FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final
 208032) 20140512, 64-bit
 (1 row)

 postgis222=# vacuum FULL ANALYZE VERBOSE test;
 INFO:  vacuuming "public.test"
 INFO:  "test": found 0 removable, 1 nonremovable row versions in 1 pages
 DETAIL:  0 dead row versions cannot be removed yet.
 CPU 0.00s/0.00u sec elapsed 0.00 sec.
 INFO:  analyzing "public.test"
 INFO:  "test": scanned 1 of 1 pages, containing 1 live rows and 0 dead
 rows; 1 rows in sample, 1 estimated total rows
 VACUUM
 postgis222=#

 -- YEH NO CRASH
 }}}


 So given that I can't get even the 2.2.2 to crash (which others were very
 successful with and I was successful with on another freebsd server (and
 only difference is the liblwgeo.h patch from #3604 or something else that
 FreeBSD package people are hacking that I'm not doing when I compile, to
 the best of my knowledge, if it was an issue in PostGIS code, the issue is
 resolved and probably caused by a rogue liblwgeom.h


 People if you are still having issues feel free to reopen this.

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