-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
6u29
-
x86
-
linux
FULL PRODUCT VERSION :
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
ADDITIONAL OS VERSION INFORMATION :
Ubuntu SMP Mon Oct 18 21:00:20 UTC 2010 i686 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The code here (http://www.java2s.com/Code/Java/File-Input-Output/Readsomedatafromagzipfile.htm) will throw an OutOfMemoryException with the following corrupt gzip file (http://www.box.com/s/836vtdlmrzd8ch2c9m4y).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Throw some sort of Exception, not an Error
ACTUAL -
Throws an OutOfMemoryException which shouldn't happen just because the gzip file is corrupt.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.OutOfMemoryError
at java.util.zip.Inflater.inflateBytes(Native Method)
at java.util.zip.Inflater.inflate(Inflater.java:238)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:135)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Catch the exception (its very very bad to catch an OOM exception)
This is reproducible on JDK6, which still uses zlib 1.1.3.
JDK7 (use zlib 1.2.3) and JDK8(use zlib 1.2.5) now throw the appropriate exception as
Exception in thread "main" java.util.zip.ZipException: invalid distances set
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:116)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:154)
at java.io.BufferedReader.readLine(BufferedReader.java:317)
at java.io.BufferedReader.readLine(BufferedReader.java:382)
Closed with "not reporducible" (for jdk7 and 8). Escalate if this issue need to be addressed in 6u release.
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
ADDITIONAL OS VERSION INFORMATION :
Ubuntu SMP Mon Oct 18 21:00:20 UTC 2010 i686 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The code here (http://www.java2s.com/Code/Java/File-Input-Output/Readsomedatafromagzipfile.htm) will throw an OutOfMemoryException with the following corrupt gzip file (http://www.box.com/s/836vtdlmrzd8ch2c9m4y).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Throw some sort of Exception, not an Error
ACTUAL -
Throws an OutOfMemoryException which shouldn't happen just because the gzip file is corrupt.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.OutOfMemoryError
at java.util.zip.Inflater.inflateBytes(Native Method)
at java.util.zip.Inflater.inflate(Inflater.java:238)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:135)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Catch the exception (its very very bad to catch an OOM exception)
This is reproducible on JDK6, which still uses zlib 1.1.3.
JDK7 (use zlib 1.2.3) and JDK8(use zlib 1.2.5) now throw the appropriate exception as
Exception in thread "main" java.util.zip.ZipException: invalid distances set
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:116)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:154)
at java.io.BufferedReader.readLine(BufferedReader.java:317)
at java.io.BufferedReader.readLine(BufferedReader.java:382)
Closed with "not reporducible" (for jdk7 and 8). Escalate if this issue need to be addressed in 6u release.