[GRASS-dev] [GRASS GIS] #1932: r.univar segfault on map with massive values

GRASS GIS trac at osgeo.org
Wed Apr 17 04:51:00 PDT 2013


#1932: r.univar segfault on map with massive values
----------------------+-----------------------------------------------------
 Reporter:  hamish    |       Owner:  grass-dev@…              
     Type:  defect    |      Status:  new                      
 Priority:  normal    |   Milestone:  6.4.3                    
Component:  Raster    |     Version:  svn-develbranch6         
 Keywords:  r.univar  |    Platform:  Linux                    
      Cpu:  x86-64    |  
----------------------+-----------------------------------------------------
 as seen on the ML:
  http://lists.osgeo.org/pipermail/grass-user/2013-April/067810.html

 r.univar's stack gets smashed if the values in the map are huge:

 {{{
 G65> g.region -d    # spearfish
 G65> r.mapcalc "bigvals = 1.0e200 * elevation.10m"

 G65> r.info -r bigvals
 min=1.061111206e+203
 max=1.846390747e+203

 G65> r.univar bigvals
  100%
 Segmentation fault

 G65> g.gisenv set="DEBUG=5"
 G65> r.univar bigvals
 ...
 D2/5: G__read_Cell_head
 D2/5: G__read_Cell_head_array
 D3/5: region item: proj:       1
 D3/5: region item: zone:       13
 D3/5: region item: north:      4928010
 D3/5: region item: south:      4913700
 D3/5: region item: east:       609000
 D3/5: region item: west:       589980
 D3/5: region item: cols:       634
 D3/5: region item: rows:       477
 D3/5: region item: e-w resol:  30
 D3/5: region item: n-s resol:  30
 D3/5: region item: format:     -1
 D3/5: region item: compressed: 1
 D3/5: create window mapping (634 columns)
  100%
 Segmentation fault

 G65> g.gisenv set="DEBUG=0"
 G65> gdb `which r.univar`
 (gdb) run bigvals
 [...]
 Program received signal SIGSEGV, Segmentation fault.
 0x00000000004036e0 in print_stats (stats=0x608490) at stats.c:141
 141                 fprintf(stdout, "total null and non-null cells: %d\n",
 stats[z].size);
 }}}


 Hamish

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



More information about the grass-dev mailing list