Artifacts Associated With Ticket 3390073
Ticket change [55d393184e] (rid 94217) by rich123 on 2011-08-11 14:36:05:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Performing the example at the top of http://wiki.tcl.tk/4610 for generating a gzip file with 8.6b2 fails: % set file critcl.kit critcl.kit % set fin [open $file rb] file5 % set header [dict create \ filename $file time [file mtime $file] comment "Created by Tcl[info patchlevel]"] filename critcl.kit time 1313070437 comment {Created by Tcl8.6b2} % set fout [zlib push gzip [open $file.gz wb] -header $header] file6 % fcopy $fin $fout 161266 % close $fin % close $fout % exit rellis@d820:~/downloads/tcl86b2/inst/usr/local/bin$ gunzip -tv critcl.kit.gz critcl.kit.gz: gzip: critcl.kit.gz: invalid compressed data--format violated 8.6b2 was compiled for, and running under, Slackware 13.1 64-bit. GCC version is 4.4.4. - foundin initialized to: "obsolete: 8.6b2"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "rich123"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: "But in zlib command in 8.6b2"
- type initialized to: "Bug"
Ticket change [b84fea6082] (rid 128946) by rich123 on 2011-08-11 21:36:30:
- title changed to: "Bug in zlib command in 8.6b2"
Ticket change [4734f22500] (rid 99657) by rich123 on 2011-08-12 00:53:54:
- icomment:
Another test to narrow down the culprit: % set file critcl.kit critcl.kit % set fin [open $file rb] file5 % set header [dict create filename $file time [file mtime $file] comment "Created by Tcl[info patchlevel]"] filename critcl.kit time 1313079102 comment {Created by Tcl8.6b2} % set fout [open $file.gz wb] file6 % set comp [ zlib gzip $data -header $header ] ; list % puts -nonewline $fout $comp % close $fin % close $fout % exit rellis@d820:~/downloads/tcl86b2/inst/usr/local/bin$ gunzip -tv critcl.kit.gz critcl.kit.gz: OK Not using zlib push gzip produces a correct gzip file. - login: "rich123"
- mimetype: "text/plain"
- username: "rich123"
- icomment:
Ticket change [bfb9e2a06a] (rid 102293) by rich123 on 2011-08-12 01:18:49:
- icomment:
Another data point: The example from http://wiki.tcl.tk/4610 using 8.6b2 produces a proper gzip file on 32-bit Linux compiled with GCC 4.2.4.
- login: "rich123"
- mimetype: "text/plain"
- username: "rich123"
- icomment:
Ticket change [4c82125adb] (rid 126902) by rich123 on 2011-08-12 08:25:59:
- icomment:
Following up on the posting to comp.lang.tcl "zlib push creates corrupt file gz file when source size is equal or greater than 8092" this test script: puts "Tcl[ info patchlevel ]" set zeros [ open /dev/zero {RDONLY BINARY} ] foreach size {8191 8192} { set data [ read $zeros $size ] set fout [ open $size {WRONLY CREAT BINARY} ] puts -nonewline $fout $data close $fout set fin [open $size rb] set header [dict create filename $size time [file mtime $size] comment "Created by Tcl[info patchlevel]"] set fout [zlib push gzip [open $size.gz wb] -header $header] fcopy $fin $fout close $fin close $fout } close $zeros Produces this result on 64-bit Linux - GCC 4.4.4: rellis@d820:~/downloads/tcl86b2/inst/usr/local/bin$ ./tclsh8.6 testgzip.tcl Tcl8.6b2 rellis@d820:~/downloads/tcl86b2/inst/usr/local/bin$ gunzip -tv *gz 8191.gz: OK 8192.gz: gzip: 8192.gz: invalid compressed data--format violated And produces these resulting files: 8 -rw-r--r-- 1 rellis 8191 2011-08-11 21:22 8191 4 -rw-r--r-- 1 rellis 72 2011-08-11 21:22 8191.gz 8 -rw-r--r-- 1 rellis 8192 2011-08-11 21:22 8192 8 -rw-r--r-- 1 rellis 4159 2011-08-11 21:22 8192.gz - login: "rich123"
- mimetype: "text/plain"
- username: "rich123"
- icomment:
Ticket change [77a67439bd] (rid 89814) by rich123 on 2011-08-12 08:29:59:
- icomment:
I also have to retract my report re. 32-bit linux. The 32-bit system exhibits identical behavior to the 64-bit system on the test script.
- login: "rich123"
- mimetype: "text/plain"
- username: "rich123"
- icomment:
Add attachment "testgzip.tcl" [5ec21c0463] (rid 115681) by rich123 on 2011-08-12 08:31:38.
Ticket change [3e76e00882] (rid 121270) by rich123 on 2011-08-12 08:31:38:
- icomment:
File Added - 420930: testgzip.tcl
- login: "rich123"
- mimetype: "text/plain"
- username: "rich123"
- icomment:
Ticket change [22956f21d2] (rid 130772) by dkf on 2011-08-12 17:01:45:
- closedate changed to: "2011-08-12T10:01:45"
- closer changed to: "dkf"
- icomment:
allow_comments - 1 Was completely broken, but a one-line fix (was returning the wrong length of written data from the transform guts). Note that _all_ compressing transforms were broken. Fixed in trunk tip. Workaround is to read the binary data in and compress with [zlib gzip] *or* use the [zlib stream gzip] to make a compressing stream (so you can process the data a bit at a time). [substitute gzip with compress or deflate if you prefer]
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"