[postgis-tickets] [PostGIS] #4246: Undefined behaviour in define_plane

PostGIS trac at osgeo.org
Tue Nov 20 03:03:43 PST 2018


#4246: Undefined behaviour in define_plane
-------------------------+---------------------------
  Reporter:  Algunenano  |      Owner:  Algunenano
      Type:  defect      |     Status:  new
  Priority:  high        |  Milestone:  PostGIS 3.0.0
 Component:  postgis     |    Version:  trunk
Resolution:              |   Keywords:
-------------------------+---------------------------
Changes (by Algunenano):

 * owner:  pramsey => Algunenano


Comment:

 Disabling optimizations gives a clearer view; `vl` is 0:
 {{{
 #0  0x00007fa1e1151b2e in define_plane (pa=0x55c1ce446560,
 pl=0x7ffe1a2fffd8) at measures3d.c:1183
 1183                    sumx+=(v.x/vl);
 (gdb) bt f
 #0  0x00007fa1e1151b2e in define_plane (pa=0x55c1ce446560,
 pl=0x7ffe1a2fffd8) at measures3d.c:1183
         i = 3
         j = 1
         numberofvectors = 3
         pointsinslice = 1
         p = {x = 3, y = 3, z = 3}
         p1 = {x = 0, y = 0, z = 0}
         p2 = {x = 2, y = 2, z = 2}
         sumx = 0
         sumy = 0
         sumz = 0
         vl = 0
         v1 = {x = -1.6666666666666667, y = -1.6666666666666667, z =
 -1.6666666666666667}
         v2 = {x = 0.33333333333333326, y = 0.33333333333333326, z =
 0.33333333333333326}
         v = {x = 0, y = 0, z = 0}
 }}}

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