Bugs item #1252702, was opened at 2005-08-05 17:47
Message generated for change (Comment added) made by dkf
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1252702&group_id=12997
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: 81. Portability
Group: current: 8.4.11
Status: Open
Resolution: None
>Priority: 8
Submitted By: Jochen Roemmler (jroemmler)
>Assigned to: Donal K. Fellows (dkf)
Summary: regression tests fail on Solaris 10/x86_64
Initial Comment:
Hello,
I'm facing a serious problem on our SUNfire V20z
machine (Operon) running Solaris 10/x86:
After a successful compilation of Tcl/Tk 8.4.11 I run
the regression tests (make test). It fails on
choosedir.tcl with the following Tcl-stack trace:
can't modify -cursor option after widget is created
while executing
"$w config -cursor watch"
(procedure "::tk::dialog::file::Update" line 49)
invoked from within
"::tk::dialog::file::Update .__tk_choosedir"
("after" script)
Looking into the Tk sources I found serious 64-bit
portability bugs at several places. For example in
generic/tkFrame.c:787 [function FrameWidgetObjCmd()]
the wrong lines of code are:
size_t length;
char *arg = Tcl_GetStringFromObj(objv[i], (int *) &length);
From now on the content of length is completely
platform dependent (e.g. bigEndian vs. littleEndian).
As a result the following calls to strncmp(arg,
"-class", length) is random, because if length is e.g.
negative, it always gives me 0 (match!) even if arg is
"-cursor" ...
An easy fix for this could look like this:
size_t length;
int len;
char *arg = Tcl_GetStringFromObj(objv[i], &len);
length = len;
...or (better) change the signature of
Tcl_GetStringFromObj to accept a size_t* as a last
argument instead of a int*.
At least these files contain the same bug:
# egrep -l "Tcl_GetStringFromObj\(.*int"
tk8.4.11/generic/*.c
tkCanvLine.c
tkCanvPoly.c
tkCanvText.c
tkCanvas.c
tkConfig.c
tkFocus.c
tkFrame.c
tkGrid.c
tkImgPhoto.c
tkPack.c
BTW: the latest development branch 8.5.a3 still
contains the same bugs.
Thanks for looking into this,
Jochen
----------------------------------------------------------------------
>Comment By: Donal K. Fellows (dkf)
Date: 2005-08-05 21:58
Message:
Logged In: YES
user_id=79902
Tcl_GetStringFromObj() really has to take a signed second
arg, even though this sucks. I've got a long-standing thing
assigned to me to fix up the mess and make it a long*, but
there's no practical way to do it and maintain even a
semblance of binary or source compatibility so I've been
waiting for the next major release to clean out this
particular swamp. (I had a go on a branch, but it's like
pulling at a thread and seeing a whole tapestry unravel.)
OTOH, you're quite right about it being bad to mix int* and
size_t*
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1252702&group_id=12997

Bugs item #1230346, was opened at 2005-06-30 09:19
Message generated for change (Comment added) made by kennykb
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1230346&group_id=10894
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: 18. Commands M-Z
Group: obsolete: 8.4.9
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Kraft (matzek)
Assigned to: Kevin B KENNY (kennykb)
Summary: Another [string is integer] inconsistency
Initial Comment:
Maybe related to bug [ 718878 ].
On a 32bit Linux system using Tcl 8.4.9:
% set foo 4294967295
4294967295
% string is integer $foo
1
% set foo 4294967296
4294967296
% string is integer $foo
0
% set foo 2147483648
2147483648
% string is integer $foo
1
% set foo 2147483647
2147483647
% string is integer $foo
1
On a 64bit Solaris 5.8 system using a 64bit Tcl 8.4.9:
% set foo 4294967295
4294967295
% string is integer $foo
0
% set foo 4294967296
4294967296
% string is integer $foo
0
% set foo 2147483648
2147483648
% string is integer $foo
0
% set foo 2147483647
2147483647
% string is integer $foo
1
So there are different results in the range from
2147483648 (1<<31) up to (and including) 4294967295
((1<<32)-1).
-- Matthias Kraft
----------------------------------------------------------------------
>Comment By: Kevin B KENNY (kennykb)
Date: 2005-08-05 15:28
Message:
Logged In: YES
user_id=99768
I think that Matthias needs the 8.5 [string is wide]
functionality.
----------------------------------------------------------------------
Comment By: Don Porter (dgp)
Date: 2005-06-30 12:29
Message:
Logged In: YES
user_id=80530
Actually, yes you do care.
Some commands accept only
those arguments that pass
Tcl_GetIntFromObj.
For example,
[lindex $list $index]
Forgetting for a moment the special
forms "end-", etc. for indices, if $index
is a string of digits, then you need then
to be digits that pass [string is integer $index].
% string is integer 9999999999
0
% lindex c 9999999999
bad index "9999999999": must be integer?[+-]integer? or
end?[+-]integer?
So, you need to choose the
validation command that matches your
intended use. It might be
[string is wideinteger]. It might be your
regexp. All depends on what your
eventual use will accept/reject. Choose
the matching validator.
----------------------------------------------------------------------
Comment By: Matthias Kraft (matzek)
Date: 2005-06-30 12:23
Message:
Logged In: YES
user_id=330806
Well, from my point of view I don't care about
Tcl_GetIntFromObj(). Script level is what counts, if script
level commands are used. I want to know if the user or
system provided a valid integer, not a string, nor a double
or whatever ...
The big numbers are essential, as I am going to check
whether or not I have enough place on the filesystem (e. g.
in this case for creating databases). Currently I use
[regexp -- {^-?[0-9]+$} $size] to validate the value I got
from the system. But I do it quite a number of times, so I'd
like to get rid of regexp, if there is a faster method...
-- Matthias Kraft
----------------------------------------------------------------------
Comment By: Don Porter (dgp)
Date: 2005-06-30 10:09
Message:
Logged In: YES
user_id=80530
[string is integer] is meant to tell you
whether a value can have
Tcl_GetIntFromObj() called on it.
Since sizeof(int) can be different on
different systems, so can the results
of [string is integer].
That said, your 64-bit results look wrong.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1230346&group_id=10894

Patches item #1242844, was opened at 2005-07-21 23:55
Message generated for change (Settings changed) made by andreas_kupries
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=310894&aid=1242844&group_id=10894
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: 09. Linked C Variables
Group: TIP Implementation
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Jeffrey Hobbs (hobbs)
>Summary: TIP #254 (New types for Tcl_*Link* functions)
Initial Comment:
From: rene.meyer@...
This patch add the following types to the Tcl_*Link* functions:
- char
- unsigned char
- short
- unsigned short
- unsigned int
- long
- unsigned long
- float
There is no impact on existing functionality.
The patch can be applied to the 8.4 and 8.5 branch.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=310894&aid=1242844&group_id=10894