commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Shipilev (JIRA)" <>
Subject [jira] Created: (COMPRESS-116) ZipArchiveInputStream fails to uncompress stream generated by InfoZip
Date Mon, 05 Jul 2010 12:27:51 GMT
ZipArchiveInputStream fails to uncompress stream generated by InfoZip

                 Key: COMPRESS-116
             Project: Commons Compress
          Issue Type: Bug
          Components: Archivers
    Affects Versions: 1.0
         Environment: Linux, Info-ZIP 3.0 (July 5th 2008), Compress 1.0

            Reporter: Aleksey Shipilev

Current Compress implementation silently fails to uncompress streaming zip coming from Info-ZIP.

Should this behaviour proven to be adherent to spec, some sort of Exception should be thrown
instead of silencing the error.

Steps to reproduce:

1. Download sample-*.zip. These two files were generated with Info-ZIP. was generated with "zip -r temp/". was generated with "zip -fd -r - temp/ >". Note
that "-fd" flag forces data descriptors in stream. This is enabled automatically if the pipe
sink is not the file, e.g. if you call it as "zip -r - temp/ | pv >".
For convenience, I did it by forcing descriptors via flag.

2. Download, compile and run, placing Compress on classpath.

3. Observe the following output:

name=temp/, size=0
Read 0 bytes
name=temp/test.100, size=100
Read 100 bytes
name=temp/test.10000, size=10000
Read 10000 bytes
name=temp/, size=10170
Read 10170 bytes
name=temp/test.1M, size=1048576
Read 1048576 bytes
name=temp/test.10M, size=10485760
Read 10485760 bytes

name=temp/, size=0
Read 0 bytes
name=temp/test.100, size=-1
Read 100 bytes
name=temp/test.10000, size=-1
Read 10000 bytes
name=temp/test.10M, size=-1
Read 10485760 bytes
name=temp/, size=-1
Read 0 bytes

Note that sample-ordinary is read OK, while streaming version had failed read on one of the
No exceptions are thrown, the implementation thinks the stream is actually over.

Another finding: this reproduces perfectly when there's at least one STORED entry in the stream.

Generating Info-ZIP files with maximum compression (e.g. all entries are DEFLATED) works around
this problem.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message