java.util.zip.DataFormatException: invalid distance too far back

JDK Bug System | Webbug Group | 3 years ago
  1. 0

    FULL PRODUCT VERSION : java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) ADDITIONAL OS VERSION INFORMATION : Windows 7 Linux dev-linux-1 2.6.18-308.13.1.el5 #1 SMP Thu Jul 26 05:45:09 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux A DESCRIPTION OF THE PROBLEM : The code reads the contents of a cab archive which uses MSZIP compression. This is a sequence of blocks, where each block has a header and then a set of bytes compressed with normal zip compression. Those bytes should be readable with java.util.zip.Inflater, and in 1.6 this works, but in 1.7, on the second block it gives the following error: java.util.zip.DataFormatException: invalid distance too far back at java.util.zip.Inflater.inflateBytes(Native Method) at java.util.zip.Inflater.inflate(Inflater.java:259) at CabTestCase$MSZipInputStream.read(CabTestCase.java:86) REGRESSION. Last worked in version 6u45 ADDITIONAL REGRESSION INFORMATION: java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Take any text file larger than 32K. Use the Windows makecab utility (included with Windows 7) to create a cab archive from it as follows: Put the following lines into a file called caboptions, replacing "bigfile.txt" with the name of your text file (don't include the dashes): -- -- -- .OPTION EXPLICIT .Set CabinetNameTemplate=test.cab .Set Cabinet=on .Set Compress=on bigfile.txt -- -- -- Run this command: makecab /f options ** EDIT - I've uploaded a test cab file which reproduces the issue also. e.g : C:\jdk8\bin\java CabTestCase test.cab blah <same exception as below seen> Compile the code provided below and pass the resulting test.cab file as the first argument, any name for the output file as the second argument. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - The original (uncompressed) text file should be copied into the output file. ACTUAL - Exception in thread "main" java.io.IOException: java.util.zip.DataFormatException: invalid distance too far back at CabTestCase$MSZipInputStream.read(CabTestCase.java:103) at java.io.FilterInputStream.read(FilterInputStream.java:133) at CabTestCase$CountingInputStream.read(CabTestCase.java:881) at CabTestCase$EntryStreamWrapper.read(CabTestCase.java:803) at CabTestCase$EntryStreamWrapper.read(CabTestCase.java:807) at CabTestCase.main(CabTestCase.java:37) Caused by: java.util.zip.DataFormatException: invalid distance too far back at java.util.zip.Inflater.inflateBytes(Native Method) at java.util.zip.Inflater.inflate(Inflater.java:259) at CabTestCase$MSZipInputStream.read(CabTestCase.java:86) ... 5 more REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- <See attachment CabTestCase.java> ---------- END SOURCE ----------

    JDK Bug System | 3 years ago | Webbug Group
    java.util.zip.DataFormatException: invalid distance too far back
  2. 0

    GitHub comment 576#211673393

    GitHub | 8 months ago | akiezun
    htsjdk.samtools.util.RuntimeIOException: java.util.zip.DataFormatException: invalid distance too far back
  3. 0

    java.util.zip.DataFormatException: invalid distance too far back — GATK-Forum

    broadinstitute.org | 4 months ago
    htsjdk.samtools.util.RuntimeIOException: java.util.zip.DataFormatException: invalid distance too far back
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Exception in thread "main" htsjdk.samtools.util.RuntimeIOException: java.util.zip.DataFormatExceptio — GATK-Forum

    broadinstitute.org | 4 months ago
    htsjdk.samtools.util.RuntimeIOException: java.util.zip.DataFormatException: invalid distance too far back
  6. 0

    What's wrong with this use of java Deflater/Inflater with a dictionary

    Stack Overflow | 2 years ago | Archie
    java.util.zip.DataFormatException: invalid distance too far back

    13 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.zip.DataFormatException

      invalid distance too far back

      at java.util.zip.Inflater.inflateBytes()
    2. Java RT
      Inflater.inflate
      1. java.util.zip.Inflater.inflateBytes(Native Method)
      2. java.util.zip.Inflater.inflate(Inflater.java:259)
      2 frames
    3. Unknown
      CabTestCase$MSZipInputStream.read
      1. CabTestCase$MSZipInputStream.read(CabTestCase.java:86)
      1 frame