[GRASS5] Re: [bug #1052] (grass) [rsv].proj are crashing

Glynn Clements glynn.clements at virgin.net
Wed May 22 18:41:40 EDT 2002


Markus Neteler wrote:

> > > 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:

[snip]

Your debug output doesn't make much sense.

> In general the function seems to work well (it is used often,
> only it suddenly crashes).

Basically, there are two likely possibilities. Either something is
corrupting the environment array, or something is passing a bad
argument to G_getenv() or similar.

The only reliable way to find out exactly what is happening is to
examine the program state at the point that the segfault occurs;
primarily, the arguments which are passed to strcmp().

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list