Bug 1419841

Summary: perl-Compress-Raw-Zlib-2.071-1.fc26 FTBFS: deflateParams() tests in t/02zlib.t fail with zlib ≥ 1.2.9
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: perl-Compress-Raw-ZlibAssignee: Petr Pisar <ppisar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jplesnik, paul, perl-devel
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-Compress-Raw-Zlib-2.071-2.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-07 14:44:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1420326    

Description Petr Pisar 2017-02-07 08:46:16 UTC
perl-Compress-Raw-Zlib-2.071-1.fc26 fails to build in F26 because tests fail:

t/01version.t ...... ok
#     Failed test (t/02zlib.t at line 557)
#          got: -5
#     expected: 0
#     Failed test (t/02zlib.t at line 568)
#          got: -5
#     expected: 0
#     Failed test (t/02zlib.t at line 579)
#          got: -5
#     expected: 0
#     Failed test (t/02zlib.t at line 598)
#          got: -3
#     expected: 1
[...]
# Looks like you failed 5 tests of 318.
t/02zlib.t ......... 
Dubious, test returned 5 (wstat 1280, 0x500)
Failed 5/318 subtests 

This is caused by upgrading zlib from 1.2.8 to 1.2.9.

Comment 1 Petr Pisar 2017-02-07 08:53:18 UTC
From zlib changelog:

Changes in 1.2.9 (31 Dec 2016)
- Assure that deflateParams() will not switch functions mid-block

The test does:

    ok(($x, $err) = new Compress::Raw::Zlib::Deflate(
                       -AppendOutput   => 1,
                       -Level    => Z_DEFAULT_COMPRESSION,
                       -Strategy => Z_DEFAULT_STRATEGY)) ;

And then changes the deflate configuration:

    # change both Level & Strategy
    $status = $x->deflateParams(-Level => Z_BEST_SPEED, -Strategy => Z_HUFFMAN_ONLY, -Bufsize => 1236) ;
    cmp_ok $status, '==', Z_OK ;

So it looks like the test checks a feature that is not supported by recent zlib anymore.

Comment 2 Petr Pisar 2017-02-07 09:19:46 UTC
I confirm the zlib change was introduced by zlib commit:

commit 7161ad76e2d0ac7de2a6235fcad3b9dfc99e9140
Author: Mark Adler <madler.edu>
Date:   Tue Nov 22 23:29:19 2016 -0800

    Assure that deflateParams() will not switch functions mid-block.
    
    This alters the specification in zlib.h, so that deflateParams()
    will not change any parameters if there is not enough output space
    in the event that a block is emitted in order to allow switching
    the compression function.

Comment 3 Petr Pisar 2017-02-07 14:09:57 UTC
I posted a fix to upstream.