Tcl Library Source Code

View Ticket
Login
Ticket UUID: 7bd2d439ca61da14a9fc5e8372e5fb1f86c28ff1
Title: "crc32 -filename $name" end in error on files with special content (not encoding problem)
Type: Bug Version: 2.0 with 1.3.4
Submitter: anonymous Created on: 2025-08-04 17:38:15
Subsystem: crc Assigned To:
Priority: 6 Severity: Critical
Status: Open Last Modified: 2025-08-05 13:12:00
Resolution: None Closed By: nobody
    Closed on:
Description:
Old Tcl scripts running on 8.6.x+ with corresponding Tcllib for crc32 package produce a checksum.
Now with Tcl 9.0.1 and corresponding Tcllib the crc32 package do the same,
but for some file's content an error occur.

Error message from "::crc::crc32" is "integer value too large to represent".
Problem seems to be inside of an operation of
"::crc::Crc32Update" and/or "::crc::Crc32Final".
If You install BAWT 3.0.1 64-Bit Tcl/Tk 9.0.1 for/on Windows 10/11,
You can check at least with the two following smallest files available:
C:\Tcl\lib\poTcllib3.0.0\poExec.tcl      2024-08-16 20:26:04   4108
C:\Tcl\lib\tcllib2.0\valtype\luhn5.tcl   2024-09-13 19:48:12   4121

Both files have correct UTF-8 encoding with simple UNIX-LF.
So there is another reason for this problem than the encoding of the file's contents.
(My first thinking is therefore wrong and I changed this description.)
Can anybody debug deeper into this?

Simple test in Tcl:
package require crc32
::crc::crc32 -filename "C:/Tcl/lib/tcllib2.0/valtype/luhn5.tcl"

I use on ActiveTcl 8.6.4.1 crc32 1.3.2 and found it on BAWT-distribution 3.0.1,
Tcllib 2.0, crc32 1.3.4 thanks.

Best greetings, Thomas [TWu]
User Comments: anonymous (claiming to be [TWu]) added on 2025-08-05 13:12:00:
Please see https://wiki.tcl-lang.org/page/expr+problems+with+int
and https://wiki.tcl-lang.org/page/Proper+integers+for+Tcl+8.5+or+9.0
Maybe these are points to here as error-message and check-sum is cited there.