JVM crash in java.util.zip.ZipFile on JDK8
Environment
- OpenJDK8
Issue
- The fatal error log header shows the crash within
libzip:
# Java VM: OpenJDK 64-Bit Server VM (25.342-b07 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libzip.so+0x4c59] readCEN+0x8e9
- The fatal error stack shows the top java frame in 'java.util.zip.ZipFile':
C [libzip.so+0x4c59] readCEN+0x8e9
C [libzip.so+0x5eb0] ZIP_Put_In_Cache0+0x120
C [libzip.so+0x3b77] Java_java_util_zip_ZipFile_open+0xf7
J 1514 java.util.zip.ZipFile.open(Ljava/lang/String;IJZ)J (0 bytes) @ 0x00007f75e151c112 [0x00007f75e151c040+0xd2]
Resolution
Address the application or operations use case resulting in the zipped file being modified/overwritten outside of the current thread, or work around the issue by disabling memory mapping in ZipFile with -Dsun.zip.disableMemoryMapping=true (at the cost of some loss in performance) or Content from bugs.openjdk.org is not included.upgrade to JDK 11.
Root Cause
- JVM crash in java.util.zip.ZipFile.getEntry
- JVM crash from java.util.zip.ZipFile.open() in libzip readCEN
Product(s)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.