[postgis-users] Assert on ST_Buffer crashes database

rox rox at tara-lu.com
Mon Mar 10 08:21:10 PDT 2014


We have been experience an intermittent problem with an ASSERT 
generated from the RightmostEdgeFinder module in the PostGIS
layer that crashes our production Postgres database.  Generally we 
modify the geometries or add a slight massage
(like Buffer(geom,0)) to the query that sources the ASSERT to avoid the 
crash for the specific scenario(s)
we find.  We run into this problem about every 2 months or so.  
Isolating which geometries are causing
the problem and fixing them or modifying the query to not fail has been 
very manpower intensive. [and .. did I mention
it crashes the production database?]

Does anybody have better ideas for us to prevent or catch/capture and 
handle these errors?

Implementation Details:

We are running on older versions of Postgres/PostGIS - due to limited 
manpower... the upgrade cycle is "slow"...
(So.. if I can argue that upgrading will prevent the assert (at least 
with geometries "like" these) - then
management might escalate the priority of that effort... )

PostGIS version: "POSTGIS="2.0.0 r9605" GEOS="3.3.3-CAPI-1.7.4" 
PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2,
released 2012/10/08" LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER"
Postgres version : "PostgreSQL 9.1.7 on x86_64-unknown-linux-gnu, 
compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit"
Ubuntu 12.04.1 LTS

Script to cause assertion:
http://ge.tt/api/1/files/9F44MmP1/0/blob?download

Log File states:

         select ST_Buffer( ST_Collect( ST_Intersection(zone,location) ), 
0)
         FROM
                 boundary , locations
         WHERE   bdy_id IN (1118508,1118498,1118497)
         AND   dl_id IN(843023,841992,841999,842000)
         ;

ng 10.0.20.226(52638) SELECT: RightmostEdgeFinder.cpp:77: void 
geos::operation::buffer::RightmostEdgeFinder::findEdge(std::vector<geos::geomgraph::DirectedEdge*>*): 
Assertion `checked>0' failed.
2014-03-10 10:50:20 EDT|15898| LOG:  server process (PID 11790) was 
terminated by signal 6: Aborted
2014-03-10 10:50:20 EDT|15898| LOG:  terminating any other active 
server processes

Removing the Buffer(...,0) above keeps these geometries from failing...
but from SVN I know we added the Buffer(...,0) to prevent an ASSERT 
from a different set of geometries [2-3 months ago].
Changing the resolution to 0.000001 also avoids the crash [for these 
geometries] (which is probably what we will do for now).

All suggestions welcome...

Roxanne



More information about the postgis-users mailing list