[GRASS5] bug reports for GRASS 5.7

Scott Mitchell smitch at mac.com
Fri Apr 2 19:08:02 EST 2004


Great, thanks.  I was just looking at it too, in an effort to start 
"thinking in C" again and get more familiar with GRASS code now that 
term is ending.  I had got as far as to figure out that the error was 
happening was the routine got to the end of the list of mapsets, but 
then got stuck as to the cause.  Your explanation is "illuminating" as 
usual.

Cheers,
Scott

On Friday, Apr 2, 2004, at 18:57 Canada/Eastern, Glynn Clements wrote:

>
> 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>
>
------
Scott W. Mitchell		Scott_Mitchell at carleton.ca
Department of Geography and Environmental Studies
Carleton University, B349 Loeb Building
Ottawa, ON Canada
+1-613-520-2600 ext 2695




More information about the grass-dev mailing list