[postgis-tickets] [PostGIS] #4031: ST_CurveToLine with small tolerance sometimes causes invalid memory alloc request size

PostGIS trac at osgeo.org
Tue Apr 24 03:47:09 PDT 2018


#4031: ST_CurveToLine with small tolerance sometimes causes invalid memory alloc
request size
----------------------+----------------------------
  Reporter:  kkgeodk  |      Owner:  strk
      Type:  defect   |     Status:  assigned
  Priority:  medium   |  Milestone:  PostGIS 2.5.0
 Component:  postgis  |    Version:  2.2.x
Resolution:           |   Keywords:  ST_CurveToLine
----------------------+----------------------------

Comment (by strk):

 So the input geometry is a CompoundCurve composed by 39 elements being
 alternating LineString and CircularString objects. Total length of
 CompoundCurve is about 180 units. Curves has mostly 3 control points and
 linestrings 2, with 2 exceptions being a LineString and a CircularString
 of 13 vertices each.

 I confirm running ST_CurveToLine([geometry], 1, 1, 1) as of r16530 fails
 about invalid memory alloc.

 The problem seems to be with the 15th arc, for which PostGIS seems to be
 unable to compute an angle:
 {{{
 DEBUG:  [lwstroke.c:lwarc_linearize:218] lwarc_linearize: maxDiff:1,
 radius:0.191861, halfAngle:nan, increment:nan (nan degrees)
 }}}

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