JDK-6860950 : Unable to READ zip files more than 2GB in size
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 5.0u23,6u16,6u17
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_7,windows_2003
  • CPU: generic,x86,sparc
  • Submitted: 2009-07-15
  • Updated: 2010-07-23
  • Resolved: 2010-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u18 b01Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
  There have been various Zip CR's reported and fixed in JDK 6 and JDK 7.
  The scope of this CR very specific, hence the need for a new CR.  Where
  applicable the related CR's are referenced in the bug report.

Platforms:  All

JDK:  All JDK 6 versions.  (JDK 7-b57 is fixed)

   We are still unable to actually Read/Extract the opened zip file (unzip2.java).

   CR 6599383 was fix in JDK 6u12 and dealt with the inability to Open a zip file
   larger than 2GB.  The testcase (unzip.java) specifically tests for Open.

   CR 4681995 deals with >4GB zip files specifically.  Allowing >4GB in JDK 6 is
   outside the scope of this issue.  

Attached Testcases:
   * MakeZipFiles.java - This will create 1.98GB and 2.01GB zip files.
   * unzip2.java - New testcase demonstrating the Read and Extract issue.
   * unzip.java - From the original 6599383 for the Open issue.

Stepts to Reproduce:

   Create zip files using MakeZipFiles.java.  Run unzip2.java.  Observe failures.

Suggested Fix:

   A fix (one line) can be found in the suggested fix section of this report.


SUGGESTED FIX This fix has been implemented by a Java Licensee and tested. The fix is also the same as the fix made in JDK7/b57. *** before/zip_util.h 2009-05-21 00:09:54.000000000 +0100 --- after/zip_util.h 2009-07-09 10:40:32.000000000 +0100 *************** *** 36,42 **** */ #define CH(b, n) (((unsigned char *)(b))[n]) #define SH(b, n) (CH(b, n) | (CH(b, n+1) << 8)) ! #define LG(b, n) (SH(b, n) | (SH(b, n+2) << 16)) #define GETSIG(b) LG(b, 0) /* --- 36,42 ---- */ #define CH(b, n) (((unsigned char *)(b))[n]) #define SH(b, n) (CH(b, n) | (CH(b, n+1) << 8)) ! #define LG(b, n) ((SH(b, n) | (SH(b, n+2) << 16)) &0xffffffffUL) #define GETSIG(b) LG(b, 0) /* *** (#1 of 1): [ UNSAVED ] ###@###.###