JDK-8223811 : When un-compressing jar, error is thrown: invalid LOC header (bad signature)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 8
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2019-05-13
  • Updated: 2019-05-20
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.
Other
tbdUnresolved
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 10, SLES 12 SP2
Java 1.8 212 and older version

A DESCRIPTION OF THE PROBLEM :
Jar is not compressed within several big files, two files over 4G and under same sub folder.
When read entry inputstream, then would throw exception: 
java.util.zip.ZipException: invalid LOC header (bad signature)
Or we can run "jarsigner -verify uncompress.jar", also report same error.

Not only on windows, also on Linux (SUSE we tried)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Generate jar without compress, and maybe need several big files under some sub folder
jar cf0 ../uncompress.jar *

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Can read the jar correctly
ACTUAL -
java.util.zip.ZipException: invalid LOC header (bad signature)

---------- BEGIN SOURCE ----------
jarsigner -verify uncompress.jar
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
jar cf ../uncompress.jar *
But the content of jar already compressed, don't want to compress again.

FREQUENCY : always



Comments
This is only reproducible on JDK 8 versions. It is fixed in JDK 9 and above and is not an issue in the latest JDK 11 , 12 or 13.
20-05-2019

Sent an email to submitter requesting for a sample jar file with which to reproduce the issue.
14-05-2019