[GRASS5] Re: [bug #1052] (grass) [rsv].proj are crashing
Markus Neteler
neteler at itc.it
Wed May 22 12:12:55 EDT 2002
On Wed, May 22, 2002 at 06:06:53PM +0200, Markus Neteler wrote:
> On Wed, May 22, 2002 at 05:57:17PM +0200, Glynn Clements via RT wrote:
> >
> > Request Tracker wrote:
> >
> > > Subject: [rsv].proj are crashing
> > >
> > > grass binary for platform: Compiled from Sources
> > >
> > > A critical bug report:
> > >
> > > v.proj in=austria loca=europa mapset=europa
> > > Segmentation fault (core dumped)
> > >
> > > Also r.proj (and eventually s.proj, untested) are affected.
> > >
> > > I have spent some time in src/libes/gis/env.c where the crash occurs
> > > in line 195 of get_env() function. The reason is unclear to me why
> > > strcmp() crashes sometimes (maybe someone else understands the
> > > problem).
> >
> > If strcmp() crashes, one of its arguments is invalid, in the sense
> > that either:
> >
> > a) it points to an invalid address (e.g. NULL), or
> > b) it points to a valid address, but scanning the string reaches an
> > invalid address before it reads a terminating NUL byte.
> >
> > So, something is passing bad values to strcmp(). In this instance,
> > either the "environment" is bad, or the caller is passing a bad "name"
> > argument to G_getenv() or similar.
>
> Here is the output of g.gisenv:
>
> g.gisenv
> LOCATION_NAME=sjtsk
> MAPSET=neteler
> DIGITIZER=none
> GISDBASE=/ssi0/ssi/blazek/pub
> MONITOR=x0
> GRASS_GUI=text
>
> which looks o.k. Also during the debugging the values seemed to
> be always set.
>
> Is there anyone else who could try the latest [rvs].proj from
> CVS (pre4 or HEAD)?
A followup: I had added some debug output into the function in
env.c:
r.proj in=dtm1km loca=europa mapset=europa dbase=/ssi0/ssi/neteler/grassdata
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: GISDBASE
count: 6 n: 1 env[n].name: MAPSET name: GISDBASE
count: 6 n: 2 env[n].name: DIGITIZER name: GISDBASE
count: 6 n: 3 env[n].name: GISDBASE name: GISDBASE
n: 3 env[n].value /ssi0/ssi/blazek/pub
count: 6 n: 0 env[n].name: LOCATION_NAME name: MAPSET
count: 6 n: 1 env[n].name: MAPSET name: MAPSET
n: 1 env[n].value neteler
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: GISDBASE
count: 6 n: 1 env[n].name: MAPSET name: GISDBASE
count: 6 n: 2 env[n].name: DIGITIZER name: GISDBASE
count: 6 n: 3 env[n].name: GISDBASE name: GISDBASE
n: 3 env[n].value /ssi0/ssi/blazek/pub
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: GISDBASE
count: 6 n: 1 env[n].name: MAPSET name: GISDBASE
count: 6 n: 2 env[n].name: DIGITIZER name: GISDBASE
count: 6 n: 3 env[n].name: GISDBASE name: GISDBASE
n: 3 env[n].value /ssi0/ssi/blazek/pub
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: MAPSET
count: 6 n: 1 env[n].name: MAPSET name: MAPSET
n: 1 env[n].value neteler
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: GISDBASE
count: 6 n: 1 env[n].name: MAPSET name: GISDBASE
count: 6 n: 2 env[n].name: DIGITIZER name: GISDBASE
count: 6 n: 3 env[n].name: GISDBASE name: GISDBASE
n: 3 env[n].value /ssi0/ssi/blazek/pub
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: GISDBASE
count: 6 n: 1 env[n].name: MAPSET name: GISDBASE
count: 6 n: 2 env[n].name: DIGITIZER name: GISDBASE
count: 6 n: 3 env[n].name: GISDBASE name: GISDBASE
n: 3 env[n].value /ssi0/ssi/blazek/pub
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: GISDBASE
count: 6 n: 1 env[n].name: MAPSET name: GISDBASE
count: 6 n: 2 env[n].name: DIGITIZER name: GISDBASE
count: 6 n: 3 env[n].name: GISDBASE name: GISDBASE
n: 3 env[n].value /ssi0/ssi/blazek/pub
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: GISDBASE
count: 6 n: 1 env[n].name: MAPSET name: GISDBASE
count: 6 n: 2 env[n].name: DIGITIZER name: GISDBASE
count: 6 n: 3 env[n].name: GISDBASE name: GISDBASE
n: 3 env[n].value /ssi0/ssi/blazek/pub
count: 6 n: 0 env[n].name: LOCATION_NAME name: LOCATION_NAME
n: 0 env[n].value sjtsk
count: 6 n: 0 env[n].name: LOCATION_NAME name: GISDBASE
count: 6 n: 1 env[n].name: MAPSET name: GISDBASE
count: 6 n: 2 env[n].name: DIGITIZER name: GISDBASE
count: 6 n: 3 env[n].name: GISDBASE name: GISDBASE
n: 3 env[n].value /ssi0/ssi/blazek/pub
Segmentation fault (core dumped)
In general the function seems to work well (it is used often,
only it suddenly crashes).
Markus
More information about the grass-dev
mailing list