GNU bug report logs - #45148
Piping into gzip --list -

Previous Next

Package: gzip;

Reported by: Stefano Marsili <efanomars <at> gmx.ch>

Date: Wed, 9 Dec 2020 19:38:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45148 in the body.
You can then email your comments to 45148 AT debbugs.gnu.org in the normal way.

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#45148; Package gzip. (Wed, 09 Dec 2020 19:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefano Marsili <efanomars <at> gmx.ch>:
New bug report received and forwarded. Copy sent to bug-gzip <at> gnu.org. (Wed, 09 Dec 2020 19:38:02 GMT) Full text and rfc822 format available.

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

From: Stefano Marsili <efanomars <at> gmx.ch>
To: bug-gzip <at> gnu.org
Subject: Piping into gzip --list -
Date: Wed, 9 Dec 2020 20:05:50 +0100
[Message part 1 (text/plain, inline)]
Hi,
I wanted to help the Debian project and found the gzip bug report

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=575884

Despite not being a C programmer I decided to give it a try.
Since this is the first time I have a patch for an open source project,
I thought that maybe I should first ask upstream if it makes sense.

In the code of gzip.c there is the comment:

 * If the lseek fails, we could use read() to get to the end, but
 * --list is used to get quick results.
 * Use "gunzip < foo.gz | wc -c" to get the uncompressed size if
 * you are not concerned about speed.

Assuming it is correct, the patch does just that, use read() to get
to the end.
After applying the patch and running

  $ time cat rnd0.bin.gz | gzip -l -

on a gzipped 3GB file created with /dev/urandom, the result is

   compressed        uncompressed  ratio uncompressed_name
   3000485948          3000000000  -0.0% stdout

   real   0m0.740s
   user   0m0.013s
   sys    0m1.134s

To me it seems quite fast, but maybe gzip is used with much bigger
files and one second is too slow.

The patch is attached to this e-mail.
I'd like to know what you think about it.
Thanks
 
 
[pipetolist.diff (text/x-patch, attachment)]

Information forwarded to bug-gzip <at> gnu.org:
bug#45148; Package gzip. (Wed, 09 Dec 2020 20:40:01 GMT) Full text and rfc822 format available.

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

From: Stefano Marsili <efanomars <at> gmx.ch>
To: 45148 <at> debbugs.gnu.org
Subject: Piping into gzip --list - new version
Date: Wed, 9 Dec 2020 21:34:48 +0100
[Message part 1 (text/html, inline)]
[gnubug45148.diff (text/x-patch, attachment)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 29 Mar 2022 23:16:02 GMT) Full text and rfc822 format available.

Notification sent to Stefano Marsili <efanomars <at> gmx.ch>:
bug acknowledged by developer. (Tue, 29 Mar 2022 23:16:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stefano Marsili <efanomars <at> gmx.ch>
Cc: 45148-done <at> debbugs.gnu.org
Subject: Re: Piping into gzip --list -
Date: Tue, 29 Mar 2022 16:15:38 -0700
Thanks for your bug report dated 2020-12-09. As it happens I was fixing 
a related bug that is commonly reported, and the patch I installed 
happened to fix your bug in a different way. The patch I installed is here:

https://git.savannah.gnu.org/cgit/gzip.git/commit/?id=cf26200380585019e927fe3cf5c0ecb7c8b3ef14

and something like this should appear in the next gzip release.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 27 Apr 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 363 days ago.

Previous Next


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