Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7010399

Bug in GZip extraction

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Duplicate
    • Affects Version/s: 6u23
    • Fix Version/s: None
    • Component/s: core-libs

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_23"
      Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
      Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

      java version "1.6.0_23"
      Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
      Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7600]

      A DESCRIPTION OF THE PROBLEM :
      Error in simple gzip extraction:

      InputStream in = new GZIPInputStream(new FileInputStream("woaifayu-ef.dict.dz"));
              while (true) {
                  int l = in.read();
                  if (l < 0)
                      break;
              }

      It reports :
      java.util.zip.ZipException: invalid stored block lengths
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
      at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:105)

      Works perfect in previous versions.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run code:

      InputStream in = new GZIPInputStream(new FileInputStream("woaifayu-ef.dict.dz"));
              while (true) {
                  int l = in.read();
                  if (l < 0)
                      break;
              }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Read without exceptions.
      ACTUAL -
      java.util.zip.ZipException: invalid stored block lengths
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
      at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:105)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.util.zip.ZipException: invalid stored block lengths
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
      at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
      at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:105)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Test {
          public static void main(String a[]) throws Exception {
              InputStream in = new GZIPInputStream(new FileInputStream("woaifayu-ef.dict.dz"));
              while (true) {
                  int l = in.read();
                  if (l < 0)
                      break;
              }
          }
      }
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dmeetry Dmeetry Degrave (Inactive)
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: