|
2021-09-24
| ||
| 13:47 | • Ticket [079d72381d] Tcl 8.7a5 hangs loading package crc16 or crc32 from tcllib 1... artifact: fae6b703ac user: jan.nijtmans | |
| 13:43 | • Closed ticket [079d72381d]. artifact: f72c610716 user: jan.nijtmans | |
|
2021-09-23
| ||
| 14:14 | • New ticket [079d72381d]. artifact: daa3ec0e9b user: anonymous | |
Tcl 8.7a5 hangs loading package crc16 or crc32 from tcllib 1.20
Closed / Duplicate079d72381d84445b3e75b4508a5e1ba1b493c768Created 5 years agoUpdated 5 years ago
Descriptionplain2021-09-23 14:14:41
Platform: Tcl8.7a5 built on Linux x86_64 with tcllib 1.20 installed
To reproduce: Start tclsh8.7 and enter 'package require crc16', tclsh
never returns to the prompt.
The hang appears to be due to a change in the behaviour of int() between
Tcl 8.6 and 8.7. The code in crc16.tcl that causes the hang is included
below, the same code can also be found in crc32.tcl.
# calculate the sign bit for the current platform.
variable signbit
if {![info exists signbit]} {
variable v
for {set v 1} {int($v) != 0} {set signbit $v; set v [expr {$v<<1}]} {}
unset v
}
Under Tcl 8.6, int($v) returns zero when the native word-length is exceeded,
under 8.7 it doesn't.
Tcl 8.6.11:
% expr int(18446744073709551616)
0
%
Tcl 8.7a5:
% expr int(18446744073709551616)
18446744073709551616
%
jan.nijtmanswiki2021-09-24 13:43:55
jan.nijtmansplain2021-09-24 13:47:39
> This is already fixed in tcllib version 1.1.4 This is fixed in crc16 version 1.1.4 (which has its own versioning) It appears that Tcllib 1.20 - which is the most recent - does not contain the fix yet. You'll have to wait for Tcllib 1.21 (or patch it yourself)
Log in (anonymous is fine) to add a comment.