[postgis-tickets] [PostGIS] #4249: Undefined behaviour in test_raster_intersects

PostGIS trac at osgeo.org
Wed Nov 21 04:29:18 PST 2018


#4249: Undefined behaviour in test_raster_intersects
------------------------+---------------------------
 Reporter:  Algunenano  |      Owner:  Algunenano
     Type:  defect      |     Status:  assigned
 Priority:  medium      |  Milestone:  PostGIS 3.0.0
Component:  raster      |    Version:  trunk
 Keywords:              |
------------------------+---------------------------
 Looks line a division by zero:

 {{{
 Program terminated with signal SIGILL, Illegal instruction.
 #0  0x0000557e97351799 in rt_raster_intersects_algorithm
 (rast1=0x557e97c6d810, rast2=0x557e97c6a130, band1=0x557e97cf00e0,
     band2=0x557e97cdfac0, hasnodata1=1, hasnodata2=1, nodata1=0,
 nodata2=0) at rt_spatial_relationship.c:722
 722             else if (FLT_EQ(((line1[Y2] - line1[Y1]) / (line1[X2] -
 line1[X1])), ((line2[Y2] - line2[Y1]) / (line2[X2] - line2[X1]))))
 (gdb) p line1
 $1 = {-1, -1, -1, 1}
 (gdb) p line2
 $2 = {0, 0, 2, 0}
 (gdb) bt
 #0  0x0000557e97351799 in rt_raster_intersects_algorithm
 (rast1=0x557e97c6d810, rast2=0x557e97c6a130, band1=0x557e97cf00e0,
     band2=0x557e97cdfac0, hasnodata1=1, hasnodata2=1, nodata1=0,
 nodata2=0) at rt_spatial_relationship.c:722
 #1  0x0000557e97350d23 in rt_raster_intersects (rast1=0x557e97c6d810,
 nband1=0, rast2=0x557e97c6a130, nband2=0, intersects=0x7fff86403344)
     at rt_spatial_relationship.c:1276
 #2  0x0000557e97329e20 in test_raster_intersects () at
 cu_spatial_relationship.c:4323
 #3  0x00007f27df460118 in ?? () from /usr/lib/libcunit.so.1
 #4  0x00007f27df4603b2 in ?? () from /usr/lib/libcunit.so.1
 #5  0x00007f27df4607b7 in CU_run_all_tests () from /usr/lib/libcunit.so.1
 #6  0x0000557e97349865 in main (argc=1, argv=0x7fff864036c8) at
 cu_tester.c:103
 }}}

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