[GRASS-dev] v.digit startup segfault - improbable fix

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

Hallo,

On Thu, May 04, 2006 at 12:52:51PM -0700, Cedric Shock wrote:

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.

It seems to work, thanks!

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.

OK, I use Tcl/Tk 8.4

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
_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

Jachym
--
Jachym Cepicky
e-mail: jachym.cepicky@centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------
OFFICE:
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky@gdf-hannover.de
URL: http://gdf-hannover.de
Tel.: +49 511-39088507

Cedric,

YOU ARE MY HERO!

Thanks. Now it works, and just in the nick of time. (I'm supposed to start digitizing some maps this weekend).

Thanks again!

Oh I'm using tcl 8.4, on a Debian sid computer:

GRASS 6.1.cvs > ldd /opt/gis/grass-6.1.cvs/bin/v.digit
[SNIP irrelevant libs]
         libtk8.4.so.0 => /usr/lib/libtk8.4.so.0 (0xa7897000)
         libtcl8.4.so.0 => /usr/lib/libtcl8.4.so.0 (0xa77c1000)
[SNIP irrelevant libs]

--Wolf

On Thu, 4 May 2006, Cedric Shock wrote:

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
_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--

<:3 )---- Wolf Bergenheim ----( 8:>