Debian Bug report logs - #647522
gzip -9n is not deterministic

version graph

Package: gzip; Maintainer for gzip is Bdale Garbee <bdale@gag.com>; Source for gzip is src:gzip.

Reported by: Jakub Wilk <jwilk@debian.org>

Date: Thu, 3 Nov 2011 14:48:02 UTC

Severity: normal

Found in version gzip/1.4-1

Fixed in version gzip/1.4-5

Done: Bdale Garbee <bdale@gag.com>

Bug is archived. No further changes may be made.

Full log


Message #55 received at 647522@bugs.debian.org (full text, mbox):

Received: (at 647522) by bugs.debian.org; 8 Feb 2012 11:36:37 +0000
From kibi@mraw.org Wed Feb 08 11:36:37 2012
X-Spam-Checker-Version: SpamAssassin 3.3.1-bugs.debian.org_2005_01_02
	(2010-03-16) on busoni.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-11.9 required=4.0 tests=BAYES_00,FOURLA,
	FROMDEVELOPER,HAS_BUG_NUMBER,MDO_CABLE_TV3,MONEY,PGPSIGNATURE,STOCKLIKE
	autolearn=ham version=3.3.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 19; hammy, 151; neutral, 64; spammy,
	0. spammytokens: hammytokens:0.000-+--H*o:Debian, 0.000-+--H*r:2a01,
	0.000-+--H*F:U*kibi, 0.000-+--KiBi, 0.000-+--H*rp:U*kibi
Return-path: <kibi@mraw.org>
Received: from glenfiddich.mraw.org ([88.191.124.82])
	by busoni.debian.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.72)
	(envelope-from <kibi@mraw.org>)
	id 1Rv5ot-0008VH-1f
	for 647522@bugs.debian.org; Wed, 08 Feb 2012 11:36:30 +0000
Received: from [2a01:e35:2ec8:9d70:21e:64ff:fe0e:9a16] (helo=bowmore.home.mraw.org)
	by glenfiddich.mraw.org with esmtp (Exim 4.72)
	(envelope-from <kibi@mraw.org>)
	id 1Rv5o1-0004Yr-F7; Wed, 08 Feb 2012 12:35:21 +0100
Received: from kibi by bowmore.home.mraw.org with local (Exim 4.77)
	(envelope-from <kibi@bowmore.home.mraw.org>)
	id 1Rv5oo-0007fu-N6; Wed, 08 Feb 2012 12:36:10 +0100
Date: Wed, 8 Feb 2012 12:36:10 +0100
From: Cyril Brulebois <kibi@debian.org>
To: Zack Weinberg <zackw@panix.com>, 647522@bugs.debian.org
Cc: bug-gzip@gnu.org, Riku Voipio <riku.voipio@iki.fi>
Subject: Re: Bug#647522: non-deterministic compression results with gzip -n9
Message-ID: <20120208113610.GA29106@mraw.org>
References: <CAKCAbMgWzxjeKJdErDK7Vud4uPuh8_eC-4zG7nC6EU44_hdXyg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="KsGdsel6WgEHnImy"
Content-Disposition: inline
In-Reply-To: <CAKCAbMgWzxjeKJdErDK7Vud4uPuh8_eC-4zG7nC6EU44_hdXyg@mail.gmail.com>
Organization: Debian
User-Agent: Mutt/1.5.21 (2010-09-15)
[Message part 1 (text/plain, inline)]
Zack Weinberg <zackw@panix.com> (07/02/2012):
> I've seen inexplicable nondeterminism like this before, and quite
> often it's turned out to be controlled by the total size of the
> command line argument area (that is, argv + environ + ELF auxv).

FWIW, a quick look on kfreebsd-amd64 with ppl's CREDITS file led me to:
  gzip -9nf CREDITS → 6343 bytes

running dh_installdocs && dh_compress with DH_VERBOSE, I noticed the
following command line:
  gzip -9nf README CREDITS
and the result → 6344 bytes.

Playing on amd64:
cbrulebois@Cygnus:/tmp/ppl-0.11.2$ cp ../ppl-pristine/{CREDITS,README} .
cbrulebois@Cygnus:/tmp/ppl-0.11.2$ gzip -9nf CREDITS README
cbrulebois@Cygnus:/tmp/ppl-0.11.2$ ls -l *gz
-rw-r--r-- 1 cbrulebois cbrulebois 6343 Feb  8 12:34 CREDITS.gz
-rw-r--r-- 1 cbrulebois cbrulebois 8745 Feb  8 12:34 README.gz
cbrulebois@Cygnus:/tmp/ppl-0.11.2$ cp ../ppl-pristine/{CREDITS,README} .
cbrulebois@Cygnus:/tmp/ppl-0.11.2$ gzip -9nf README CREDITS
cbrulebois@Cygnus:/tmp/ppl-0.11.2$ ls -l *gz
-rw-r--r-- 1 cbrulebois cbrulebois 6344 Feb  8 12:34 CREDITS.gz
-rw-r--r-- 1 cbrulebois cbrulebois 8745 Feb  8 12:34 README.gz

It looks to me like it shouldn't be hard to figure out what happens here
given the few tests I performed with the above command lines. On a few
iterations, reproducibility (with a given input command line) doesn't
seem to be an issue.

Mraw,
KiBi.
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 18:58:31 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.