[GRASS5] bug reports for GRASS 5.7

Glynn Clements glynn.clements at virgin.net
Fri Apr 2 18:57:39 EST 2004


Scott Mitchell wrote:

> > > (gdb) run -l
> > > Starting program: /usr/local/grass57-13_02_2004/bin/g.mapsets -l
> > > Reading symbols for shared libraries +++.. done
> > >
> > > Program received signal SIGTRAP, Trace/breakpoint trap.
> > > 0x8fe1a528 in __dyld__dyld_start ()
> >
> > This is a red herring; can you continue until you get the actual
> > SIGBUS signal?
> 
> Aha !  Now this is more useful, even I can see that:
> 
> (gdb) run -l
> Starting program: /usr/local/grass57-13_02_2004/etc/bin/cmd/g.mapsets -l
> Reading symbols for shared libraries +++++.. done
> 
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> 0x90006f40 in strlen ()
> (gdb) where
> #0  0x90006f40 in strlen ()
> #1  0x0022f100 in G_store (s=0x0) at store.c:16
> #2  0x0000280c in get_available_mapsets () at get_maps.c:14
> #3  0x00001ff4 in main (argc=2, argv=0xbffffa3c) at main_cmd.c:68

That makes sense. In the loop:

    while ( ms[nmapsets] )
        mapset_name[nmapsets++] = G_store (ms[nmapsets]);

it is undefined as to whether the value of nmapsets on the RHS is the
old value or the updated value. In your case, it happens to be the
updated value. I've committed an updated version which uses a for
loop:

    for (nmapsets = 0; ms[nmapsets]; nmapsets++)
        mapset_name[nmapsets] = G_store (ms[nmapsets]);

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




More information about the grass-dev mailing list