[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"gzip -l" reports wrong original size for big files

From: Andreas Arning
Subject: "gzip -l" reports wrong original size for big files
Date: Fri, 1 Feb 2008 17:42:30 +0100

I want to report a flaw in the gzip program when using option -l

Gzip for Windows as available from http://gnuwin32.sourceforge.net/packages/gzip.htm
Version 1.3.12, 32 bit.

"gzip -l" reports wrong original size and possibly negative compression ratio when original size is bigger than 4GByte.

1. Create a file that is bigger than 4 GB, for example the file "gziptest" with size 4,394,364,468 bytes.

 2. Compress this file using gzip, in this example by "gzip gziptest"
 3. against the compressed version, run "gzip -l", in this example "gzip -l gziptest.gz"
==> gzip reports a wrong original size and possibly a negative compression rate, similar to this:
C:\temp>gzip -l gziptest.gz
         compressed        uncompressed  ratio uncompressed_name
          384204661            99397172 -286.5% gziptest
In other words, an unsigned long 32 bit integer is used for the computation which has an unhandled overflow.
Thus, the hex value 100000000x == 4,294,967,296 is accidentally subtracted from the correct original length.

If someone provides a fix for this, please let me know.

Best regards,

Dr. Andreas Arning
Master Inventor
WebSphere Business Process Solutions - Business Process Choreographer
BPM Samples  -  http://publib.boulder.ibm.com/bpcsamp/index.html
Phone: +49-7031-16-2359
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Herbert Kircher
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


reply via email to

[Prev in Thread] Current Thread [Next in Thread]