[GRASS-user] r.li help
Hamish
hamish_b at yahoo.com
Mon Aug 17 03:35:30 EDT 2009
Nathan Lemoine wrote:
> I've tried running gdb on the r.li.patchnum program, but I have no
> debugging or programming experience, so I can only report the
> error messages I've received. running the program normally, without
> of gdb, gets me the error:
>
> Illegal filename. Character <> not allowed.
> Illegal filename. Character <> not allowed.
> Illegal filename. Character <> not allowed.
> WARNING: Unable to open header file for raster map <@(null)>
> CHILD[pid = 326]: unable to open mask ... continue without!!!
>
> this error message typically just repeats itself.
....
> running the program with gdb gets me:
>
> Starting program:
> /Applications/GRASS-6.4.app/Contents/MacOS/bin/r.li.patchnum .li.patchnum
> map=northrast conf=whole out=test
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000008
> 0x00007fff806b0964 in strcmp ()
>
> and if I backtrace:
>
> (gdb) bt
> #0 0x00007fff806b0964 in strcmp ()
> #1 0x000000010005bc63 in parseSetup ()
> #2 0x000000010005c899 in calculateIndex ()
> #3 0x00000001000008c8 in start ()
you've done well with the backtrace Nathan, after so many months we
finally know where this bug is. I think Paolo might buy you a beer.
(gdb on Linux didn't give me much to go on, only that it finished
with error code 1)
see https://trac.osgeo.org/grass/ticket/718#comment:16
r.li.daemon is using strtok() in its multi-thread code, but that function
is not safe to use with threads and so the jobs collide and the program
breaks. Because r.li.daemon always starts 10 jobs, it breaks even if you
don't have a multi-processor CPU.
"The strtok() function uses a static buffer while parsing, so it's
not thread safe."
It doesn't look like it will be very hard to fix, but it's slightly
beyond my talents to do so.
Hamish
ps- for future reference, if you use "bt full" in gdb you get the value
of all variables, and if you type "l" you see which line in the source
code it got to. http://grass.osgeo.org/wiki/Bugs#Using_GDB
More information about the grass-user
mailing list