Tcl Source Code

View Ticket
Login
Ticket UUID: 73d5cb615edb917577cccac1c54e22b99a48a2c7
Title: zlib-8.8, zlib-8.16 fail on Fedora 40, gcc 14.1.1
Type: Bug Version: 8.6
Submitter: apnadkarni Created on: 2024-07-31 10:30:09
Subsystem: - New Builtin Commands Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2024-10-18 15:19:56
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2024-10-18 15:19:56
Description:
Seen on Fedora 40, gcc 14. Not seen on Windows or Ubuntu 20 (gcc 9).

```
Tests began at Wed Jul 31 12:27:10 CEST 2024
zlib.test


==== zlib-8.8 transformation and fconfigure FAILED
==== Contents of test case:

    zlib push compress $outSide -dictionary $spdyDict
    fconfigure $outSide -blocking 1 -translation binary -buffering none
    fconfigure $inSide -blocking 1 -translation binary
    puts -nonewline $outSide $spdyHeaders
    chan pop $outSide
    chan close $outSide
    set compressed [read $inSide]
    catch {zlib decompress $compressed} err opt
    list [string length [zlib compress $spdyHeaders]]  [string length $compressed]  $err [dict get $opt -errorcode] [zlib adler32 $spdyDict]

---- Result was:
261 227 {need dictionary} {TCL ZLIB NEED_DICT 2381337010} 2381337010
---- Result should have been (exact matching):
260 222 {need dictionary} {TCL ZLIB NEED_DICT 2381337010} 2381337010
==== zlib-8.8 FAILED



==== zlib-8.16 Bug 3603553: buffer transfer with large writes FAILED
==== Contents of test case:

    set f [open $file wb]
    fconfigure $f -buffering none
    zlib push gzip $f
    puts -nonewline $f $largeData
    close $f
    file size $file

---- Result was:
54408
---- Result should have been (exact matching):
57647
==== zlib-8.16 FAILED


Tests ended at Wed Jul 31 12:27:11 CEST 2024
all.tcl:        Total   73      Passed  69      Skipped 2       Failed  2

```
User Comments: jan.nijtmans added on 2024-10-18 15:19:56:

Fixed [6f86b010a65c4705|here]


apnadkarni added on 2024-10-18 05:57:21:
Thanks for looking into this. It would have not occurred to me that actual zlib library compression would have changed.

I suppose the test changes are ok.

jan.nijtmans added on 2024-10-17 21:29:16:

Let's [e5aa1e624a1c6250|change] the testcases so they pass on Fedora (zlib-ng) too.

In zlib-8.8, it doesn't matter much whether $spdyHeaders compress to 261 or to 260 bytes, but it matters that uncompressing results in the original length.

In zlib-8.16, we see that zlib-ng even compresses more than zlib. So we accept anything less than 57648.

Those changes don't affect the intention of the test-cases.


jan.nijtmans added on 2024-10-17 14:32:20:

The same failures can be seen here: https://download.copr.fedorainfracloud.org/results/jskarvad/TclTK9.0.0/fedora-rawhide-x86_64/08144852-tcl/builder-live.log.gz

Note that this build uses zlib-ng-compat in stead of zlib. So, I suspect that zlib-ng-compat is not so compatible with zlib as it should be.