#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.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);
}}}