United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6860950 Unable to READ zip files more than 2GB in size
JDK-6860950 : Unable to READ zip files more than 2GB in size

Details
Type:
Bug
Submit Date:
2009-07-15
Status:
Closed
Updated Date:
2010-07-23
Project Name:
JDK
Resolved Date:
2010-01-13
Component:
core-libs
OS:
windows_2003,solaris_7,generic
Sub-Component:
java.util.jar
CPU:
x86,sparc,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0u23,6u16,6u17
Fixed Versions:
6u18 (b01)

Related Reports
Backport:
Duplicate:
Relates:
Relates:
Relates:

Sub Tasks

Description
Note:
  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)

Description:
   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.

                                    

Comments
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 ] ###@###.###
                                     
2009-07-15
EVALUATION

yes
                                     
2009-07-17



Hardware and Software, Engineered to Work Together