GNU bug report logs - #79414
the ratio output by "gzip -l" is less than 0

Previous Next

Package: gzip;

Reported by: shi xuantong <sxt1001 <at> outlook.com>

Date: Tue, 9 Sep 2025 15:19:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

To reply to this bug, email your comments to 79414 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gzip <at> gnu.org:
bug#79414; Package gzip. (Tue, 09 Sep 2025 15:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to shi xuantong <sxt1001 <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-gzip <at> gnu.org. (Tue, 09 Sep 2025 15:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: shi xuantong <sxt1001 <at> outlook.com>
To: "bug-gzip <at> gnu.org" <bug-gzip <at> gnu.org>
Subject: the ratio output by "gzip -l" is less than 0
Date: Tue, 9 Sep 2025 15:02:50 +0000
[Message part 1 (text/plain, inline)]
gzip's version: 1.14
OS: openEuler
compiler:gcc-12.3.1

Reproduce steps:
echo "hiasdastysjdoyiojsad7saihdsd08y8768r" | gzip >> a.gz
gzip -l a.gz

result:

[cid:b070a7f1-da0a-4210-82e6-bd96683273d1]
[Message part 2 (text/html, inline)]
[image.png (image/png, inline)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 09 Sep 2025 18:06:04 GMT) Full text and rfc822 format available.

Notification sent to shi xuantong <sxt1001 <at> outlook.com>:
bug acknowledged by developer. (Tue, 09 Sep 2025 18:06:04 GMT) Full text and rfc822 format available.

Message #10 received at 79414-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: shi xuantong <sxt1001 <at> outlook.com>
Cc: 79414-done <at> debbugs.gnu.org
Subject: Re: bug#79414: the ratio output by "gzip -l" is less than 0
Date: Tue, 9 Sep 2025 11:05:03 -0700
A negative compression ratio is correct when gzip's compressed output is 
larger than its input.

Arguably gzip should output "-Inf%" when the input is empty and the 
compressed output is not. But that's a mere nicety.




Information forwarded to bug-gzip <at> gnu.org:
bug#79414; Package gzip. (Tue, 09 Sep 2025 18:13:02 GMT) Full text and rfc822 format available.

Message #13 received at 79414-done <at> debbugs.gnu.org (full text, mbox):

From: "Adler, Mark" <madler <at> alumni.caltech.edu>
To: "79414-done <at> debbugs.gnu.org" <79414-done <at> debbugs.gnu.org>
Cc: Paul Eggert <eggert <at> CS.UCLA.EDU>, shi xuantong <sxt1001 <at> outlook.com>
Subject: Re: bug#79414: the ratio output by "gzip -l" is less than 0
Date: Tue, 9 Sep 2025 18:12:35 +0000
[Message part 1 (text/plain, inline)]
pigz reports "-inf%”. Alas, a lower-case “i”.

On Sep 9, 2025, at 11:05 AM, Paul Eggert <eggert <at> CS.UCLA.EDU> wrote:

A negative compression ratio is correct when gzip's compressed output is larger than its input.

Arguably gzip should output "-Inf%" when the input is empty and the compressed output is not. But that's a mere nicety.

[Message part 2 (text/html, inline)]

Information forwarded to bug-gzip <at> gnu.org:
bug#79414; Package gzip. (Tue, 09 Sep 2025 18:41:01 GMT) Full text and rfc822 format available.

Message #16 received at 79414 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: "Adler, Mark" <madler <at> alumni.caltech.edu>
Cc: 79414 <at> debbugs.gnu.org, shi xuantong <sxt1001 <at> outlook.com>
Subject: Re: bug#79414: the ratio output by "gzip -l" is less than 0
Date: Tue, 9 Sep 2025 11:40:43 -0700
[Message part 1 (text/plain, inline)]
On 2025-09-09 11:12, Adler, Mark wrote:
> pigz reports "-inf%”. Alas, a lower-case “i”.

Thanks, good suggestion, I installed the attached into gzip.
[0001-gzip-report-Inf-for-negative-infinity.patch (text/x-patch, attachment)]

Information forwarded to bug-gzip <at> gnu.org:
bug#79414; Package gzip. (Wed, 10 Sep 2025 07:04:02 GMT) Full text and rfc822 format available.

Message #19 received at 79414 <at> debbugs.gnu.org (full text, mbox):

From: shi xuantong <sxt1001 <at> outlook.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, "Adler, Mark" <madler <at> alumni.caltech.edu>
Cc: "79414 <at> debbugs.gnu.org" <79414 <at> debbugs.gnu.org>
Subject: Re: bug#79414: the ratio output by "gzip -l" is less than 0
Date: Wed, 10 Sep 2025 01:52:36 +0000
[Message part 1 (text/plain, inline)]
However, at this point, den is not zero. For the example provided in the email, den value is 37 and num value is -2

获取Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Paul Eggert <eggert <at> cs.ucla.edu>
Sent: Wednesday, September 10, 2025 2:40:43 AM
To: Adler, Mark <madler <at> alumni.caltech.edu>
Cc: shi xuantong <sxt1001 <at> outlook.com>; 79414 <at> debbugs.gnu.org <79414 <at> debbugs.gnu.org>
Subject: Re: bug#79414: the ratio output by "gzip -l" is less than 0

On 2025-09-09 11:12, Adler, Mark wrote:
> pigz reports "-inf%”. Alas, a lower-case “i”.

Thanks, good suggestion, I installed the attached into gzip.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gzip <at> gnu.org:
bug#79414; Package gzip. (Wed, 10 Sep 2025 07:04:03 GMT) Full text and rfc822 format available.

Message #22 received at 79414 <at> debbugs.gnu.org (full text, mbox):

From: shi xuantong <sxt1001 <at> outlook.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, "Adler, Mark" <madler <at> alumni.caltech.edu>
Cc: "79414 <at> debbugs.gnu.org" <79414 <at> debbugs.gnu.org>
Subject: Re: bug#79414: the ratio output by "gzip -l" is less than 0
Date: Wed, 10 Sep 2025 02:17:26 +0000
[Message part 1 (text/plain, inline)]
Apologies,please disregard my previous msg. I misunderstood it earlier.

获取Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: shi xuantong <sxt1001 <at> outlook.com>
Sent: Wednesday, September 10, 2025 9:52:36 AM
To: Paul Eggert <eggert <at> cs.ucla.edu>; Adler, Mark <madler <at> alumni.caltech.edu>
Cc: 79414 <at> debbugs.gnu.org <79414 <at> debbugs.gnu.org>
Subject: Re: bug#79414: the ratio output by "gzip -l" is less than 0

However, at this point, den is not zero. For the example provided in the email, den value is 37 and num value is -2

获取Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Paul Eggert <eggert <at> cs.ucla.edu>
Sent: Wednesday, September 10, 2025 2:40:43 AM
To: Adler, Mark <madler <at> alumni.caltech.edu>
Cc: shi xuantong <sxt1001 <at> outlook.com>; 79414 <at> debbugs.gnu.org <79414 <at> debbugs.gnu.org>
Subject: Re: bug#79414: the ratio output by "gzip -l" is less than 0

On 2025-09-09 11:12, Adler, Mark wrote:
> pigz reports "-inf%”. Alas, a lower-case “i”.

Thanks, good suggestion, I installed the attached into gzip.
[Message part 2 (text/html, inline)]

This bug report was last modified 4 days ago.

Previous Next


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