[postgis-tickets] [PostGIS] #5004: ptarray_closest_segment2d fails on 32bit (sometimes)

PostGIS trac at osgeo.org
Mon Sep 27 09:23:58 PDT 2021


#5004: ptarray_closest_segment2d fails on 32bit (sometimes)
---------------------+---------------------------
 Reporter:  strk     |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.2.0
Component:  postgis  |    Version:  master
 Keywords:           |
---------------------+---------------------------
 I've added a test for ptarray_closest_segment_2d in
 [894916e50a63091b8c7e5fb641892379eda559c7/git] which is passing in gitlab-
 ci test32 but failing on my own 32bit chroot.

 The test invokes the function with an L-shaped linestring and a point
 collinear with on of the two segments, and closest to the common vertex.

 One would expect (and the test expects) that the "closest segment" found
 is the first one, as the actual closest point is the shared vertex, but
 under some circumstances, on a 32bit system, the code finds the second
 segment to be "closer" than the first one.

 By "some circumstances" I also mean *printing* or not the distance values
 as found, so this screams "number of bits used for computation", using
 registers or not, optimization used or not.

 I'm not sure what to do with this ticket, but if we want to GUARANTEE that
 the earliest segment is returned, when the closest point is a vertex, then
 we need some action here, other than disabling the test.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5004>
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