[GRASS-dev] Re: [GRASS GIS] #455: d.what.rast segfault
GRASS GIS
trac at osgeo.org
Fri Jan 23 23:02:34 EST 2009
#455: d.what.rast segfault
--------------------------+-------------------------------------------------
Reporter: hamish | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords:
Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by hamish):
Hi,
this bug is probably related to incomplete #392 (backport
G_is_c_null_value() to devbr6).
It fails here:
{{{
#0 0xb7f0e72a in G_get_raster_cat (rast=0x80598f0, pcats=0x8051b68,
data_type=2)
at cats.c:673
}}}
which is:
{{{
if (!G_is_c_null_value(&i) && i < pcats->ncats) {
if (pcats->labels[i] != NULL)
return pcats->labels[i];
return label;
}
}}}
because ''i'' = -2147483648 and the pcats->labels[i] lookup fails.
So either G_quant_get_cell_value() is setting ''i'' wrong, or
G_is_c_null_value() is testing it wrong.
stepping through in the debugger shows that G_quant_get_cell_value() does
[lib/gis/quant.c:line 798]
{{{
if (NO_EXPLICIT_RULE)
return NO_DATA;
if (NO_EXPLICIT_RULE)
return NO_DATA;
}}}
(huh? why twice?)
earlier,
#define NO_DATA (G_set_c_null_value (&tmp, 1), (CELL) tmp)
and
{{{
GR6.5> r.info -t elev.sl.parm.scale
datatype=DCELL
}}}
In this case I was clicking on non-NULL data:
{{{
D0/0: G_get_raster_cat(): val 131.987214 found i -2147483648
}}}
?,
Hamish
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/455#comment:1>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list