[GRASS-DEV] Re: [bug #4380] [GRASS5] v.digit still segfaults

Hamish hamish_nospam at yahoo.com
Thu May 4 06:17:27 EDT 2006


> Hallo and sorry - debuging is not my cup of tea, alas.

Threaded Tcl + C is hard for anybody.

A dumb but effective method is to start adding
  printf(" -- here line 1234\n");
in the C code and
  puts {"here line 1234"}
in the tcl code and see if you can narrow down exactly where it breaks.
When you find that you can print the variables before the call to
investiatge.

gdb hints:   [compile with -g and without optimization or stripping]

(gdb) bt f     # outputs all variable values when it broke
(gdb) l        # (lowercase "L") shows where in the source code you are
(gdb) frame 0  # switches to that function (eg #0 strlen())
(gdb) p <name> # print the value of some variable

see also doc/debugging.txt in the source code.


> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1240430368 (LWP 6305)]
> 0xb7732203 in strlen () from /lib/tls/libc.so.6
> (gdb) bt
> #0  0xb7732203 in strlen () from /lib/tls/libc.so.6
> #1  0xb7840789 in Tcl_ExternalToUtfDString () from
> #/usr/lib/libtcl8.4.so.0 2  0xb7905365 in Tk_MainEx () from
> #/usr/lib/libtk8.4.so.0 3  0x08052357 in main (argc=32,
> #argv=0xbf84c134) at main.c:197
> 
> debian testing

It's all fine for me on Debian/stable tcl/tk 8.4

Can you try compiling with tcl8.3-dev and tk8.3-dev and see if you get
the same result?



Hamish

ps - please cc relevant info to the bug report,
  https://intevation.de/rt/webrt?serial_num=4380



More information about the grass-dev mailing list