[GRASS5] Re: NVIZ + CELL map + gcc >=3.2.2 = SegFault

Hamish hamish_nospam at yahoo.com
Tue Sep 16 11:57:38 EDT 2003


> Bug #2:
>
> > Turns out the raster I was testing NVIZ out with is a CELL map.
> > Tried to run nviz on an integer based raster on a RedHat install &
> > it gave the same SegFault.
> > So NVIZ doesn't like integer based maps.
> > ...
> > building color table
> > child killed: segmentation violation
> > ...
>
> I've currently got my integer-map bug tracked down to this line on
> src/libes/ogsf/GS2.c:  (line 1445)
>   filename = G_fully_qualified_name(filename, mapset);
>
> Next is to follow G_fully_qualified_name() in
> src/libes/gis/nme_in_mps.c. Hopefully this leads somewhere.



May have found something, time to consult the C experts.

It apparently breaks while somewhere in this statement in
 src/libes/gis/nme_in_mps.c:

if(strchr(name, '@'))
        sprintf (fullname, "%s", name);
    else
        sprintf (fullname, "%s@%s", name, mapset);


--
Looking up strchr:

char *strchr(const char *s, int c);

Description
This function returns a pointer to the first occurrence of c in s. Note
that if c is NULL, this will return a pointer to the end of the string.

Return Value
A pointer to the character, or NULL if it wasn't found. 



So "if()" is testing either a pointer or NULL.

Is that kosher?


Hamish




More information about the grass-dev mailing list