Details Ticket 4380


Comment | Reply | Open


Serial Number 4380
Subject v.digit segfault
Area grass6
Queue grass
Requestors net@,wolf+grass@bergenheim
Owner cshock
Status resolved
Last User Contact Thu May 4 12:17:38 2006 (2 yr ago)
Current Priority 70
Final Priority 70
Due No date assigned
Last Action Thu May 4 22:57:43 2006 (2 yr ago)
Created Thu May 4 07:54:20 2006 (2 yr ago)

Transaction History Ticket 4380


Thu, May 4 2006 07:54:20    Request created by guest  
Subject: v.digit segfault

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: CVS HEAD 20060503

When I try to run v.digit either through gis.m d.m or commandline (doesn't matter)
it crashes.

Here is the backtrace of the core dump:
(gdb) bt
#0  0xa7718ca3 in strlen () from /lib/tls/i686/cmov/libc.so.6
#1  0xa7827789 in Tcl_ExternalToUtfDString () from /usr/lib/libtcl8.4.so.0
#2  0xa78ec365 in Tk_MainEx () from /usr/lib/libtk8.4.so.0
#3  0x08052169 in main ()

Hmm that doesn't help much.

When doing it from gis.m I get a window saying that "child process exited abnormally"
With these details:

child process exited abnormally
child process exited abnormally
    while executing
"exec -- d.mon start=x2 >& /dev/null"
    ("eval" body line 1)
    invoked from within
"eval exec -- $cmd $args >& /dev/null"
    (procedure "run" line 6)
    invoked from within
"run d.mon start=x2"
    ("eval" body line 1)
    invoked from within
"eval run $cmd $args"
    (procedure "runcmd" line 6)
    invoked from within
"runcmd "d.mon start=x$xmon""
    invoked from within
"if ![catch {open "|d.mon -L" r} input] {
			while {[gets $input line] >= 0} {
            	if {[regexp -nocase "$xmon.*not running" $line]} {
					run..."
    (procedure "GmVector::WorkOnVector" line 28)
    invoked from within
"GmVector::WorkOnVector $sel 0"
    ("vector" arm line 2)
    invoked from within
"switch $type {
        raster {
        Gm::xmon term r.digit
            return
        }
        vector {
	    GmVector::WorkOnVector $sel 0
       ..."
    (procedure "GmTree::vedit" line 16)
    invoked from within
"GmTree::vedit"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 $cmd"
    (procedure "Button::_release" line 18)
    invoked from within
"Button::_release .mainframe.topf.tb1.bbox5.b0"
    (command bound to event)
Thu, May 4 2006 12:17:38    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Thu, 4 May 2006 22:17:27 +1200
From Hamish <hamish_nospam@yahoo.com>
To Jachym Cepicky <jachym.cepicky@centrum.cz>
Cc grass5@grass.itc.it, grass-bugs@intevation.de
Subject Re: [bug #4380] [GRASS5] v.digit still segfaults
Message-Id <20060504221727.069a32c4.hamish_nospam@yahoo.com>
In-Reply-To <20060504084123.GA6192@gdf-hannover.de>
References <Pine.LNX.4.64.0605031853420.5372@localhost.localdomain> <C07E59AB.21162%michael.barton@asu.edu> <20060503201010.GA6729@gdf-hannover.de> <20060503202359.GB27842@bartok.itc.it> <20060504084123.GA6192@gdf-hannover.de>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
> 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


Thu, May 4 2006 22:57:43    Status changed to resolved by wbergenheim  
Thu, May 4 2006 22:57:43    Owner changed to cshock by wbergenheim  
Thu, May 4 2006 22:57:43    Comments added by wbergenheim  
Hi,

I carefully picked over the v.digit segfault exemplar from Ivan Marchesini. 
If you are experiencing a v.digit segfault on startup please try the new patch
I just kicked into CVS.

Hints for future debugging: set DEBUG to at least 5.
Report what tcl/tk version v.digit is being LINKED against.

I changed argument count on Tk_Main from 0 to argc. Reasoning:
Tcl_ExternalToUtfDString is used very few places in the tcl and tk sources. A
good chunk of them are in the handling of argc and argv in Tcl_Main and 
Tk_MainEx, so I'm inclined to believe the backtrace that says it's happening
here. The code doesn't look like it was written to ever expect 0 argc. This 
section of code has been entirely rewritten between tcl 8.3 and 8.4. The 8.4
code looks like it's happy with 0.

Counter reasoning: It's been 0 since forever. This had to be working for some
developer using tcl 8.3 at some time.

Counter counter reasoning: whether or not Tcl_ExternalToUtfDString calls 
strlen is dependent upon the source encoding, but here I think it's all the 
same (coming from the command line).

--Cedric
Comment | Reply | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request