Skip to content
Tcl Source Code History Of Ticket 3390073
Login

History Of Ticket 3390073

Artifacts Associated With Ticket 3390073

  1. Ticket change [55d393184e] (rid 94217) by rich123 on 2011-08-11 14:36:05:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
      
    4. foundin initialized to: "obsolete: 8.6b2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "rich123"
    10. subsystem initialized to: "18. Commands M-Z"
    11. title initialized to: "But in zlib command in 8.6b2"
    12. type initialized to: "Bug"
  2. Ticket change [b84fea6082] (rid 128946) by rich123 on 2011-08-11 21:36:30:

    1. title changed to: "Bug in zlib command in 8.6b2"
  3. Ticket change [4734f22500] (rid 99657) by rich123 on 2011-08-12 00:53:54:

    1. 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.
      
      
      
    2. login: "rich123"
    3. mimetype: "text/plain"
    4. username: "rich123"
  4. Ticket change [bfb9e2a06a] (rid 102293) by rich123 on 2011-08-12 01:18:49:

    1. 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.
      
      
      
    2. login: "rich123"
    3. mimetype: "text/plain"
    4. username: "rich123"
  5. Ticket change [4c82125adb] (rid 126902) by rich123 on 2011-08-12 08:25:59:

    1. 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
      
      
      
    2. login: "rich123"
    3. mimetype: "text/plain"
    4. username: "rich123"
  6. Ticket change [77a67439bd] (rid 89814) by rich123 on 2011-08-12 08:29:59:

    1. 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.
      
      
    2. login: "rich123"
    3. mimetype: "text/plain"
    4. username: "rich123"
  7. Add attachment "testgzip.tcl" [5ec21c0463] (rid 115681) by rich123 on 2011-08-12 08:31:38.

  8. Ticket change [3e76e00882] (rid 121270) by rich123 on 2011-08-12 08:31:38:

    1. icomment:
      
      
      File Added - 420930: testgzip.tcl
      
      
      
    2. login: "rich123"
    3. mimetype: "text/plain"
    4. username: "rich123"
  9. Ticket change [22956f21d2] (rid 130772) by dkf on 2011-08-12 17:01:45:

    1. closedate changed to: "2011-08-12T10:01:45"
    2. closer changed to: "dkf"
    3. 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]
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"