[GRASS-dev] [GRASS GIS] #2357: r3.info segfaults or reports incorrect values on Windows

GRASS GIS trac at osgeo.org
Thu Jul 3 08:12:57 PDT 2014


#2357: r3.info segfaults or reports incorrect values on Windows
-------------------------+--------------------------------------------------
 Reporter:  annakrat     |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  7.1.0                    
Component:  Raster3D     |     Version:  svn-releasebranch70      
 Keywords:  r3.info      |    Platform:  MSWindows 8              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------
 When I run r3.info on Windows on a map computed with v.vol.rst, it's
 segfaults and stops writing output after:

 {{{
  |        Projection: Lambert Conformal Conic (zone 0)
  |            N:        100    S:          0   Res:     1
  |            E:        100    W:          0   Res:     1
 }}}
 When I create a random map:

 {{{
 g.region w=0 e=100 s=0 n=100 t=100 b=0 res=1 res3=1
 r3.mapcalc "test = rand(0,100)"
 }}}

 it doesn't segfault but I get nonsense (I guess it's the same problem):

 {{{
 |        Projection: Lambert Conformal Conic (zone 0)
 |            N:        100    S:          0   Res:     1
 |            E:        100    W:          0   Res:     1
 |            T:          0    B:          0   Res:     0
 |   Range of data:   min =          0 max =          0
 }}}

 The same map copied to linux has no problems. Perhaps the function
 `format_double` could cause it since it is used for reporting top, bottom
 and range values.

 Further investigation shows that r.info reports wrong number of categories
 (0) on a map which has categories. This would again point at
 `format_double` function which looks completely the same as in r3.info.
 However, v.info seems to work although it uses again `format_double`
 function, but slightly modified:

 r(3).info:
 {{{
 void format_double(const double value, char *buf)
 {
     sprintf(buf, "%.8lf", value);
     G_trim_decimal(buf);
 }
 }}}
 v.info:
 {{{
 void format_double(double value, char *buf)
 {
     sprintf(buf, "%.8f", value);
     G_trim_decimal(buf);
 }
 }}}

 Could the `l` in the formatting make difference on Windows?

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2357>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list