JDK-7192322 : JVM could not be initialized when class data sharing is enabled and compressed strings are used
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6u21p
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-08-17
  • Updated: 2014-07-21
  • Resolved: 2012-11-30
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.
JDK 6
6u60 b01Fixed
Description
Error during JVM initialization occurred when class data sharing and compressed strings are used simultaneously:
>java -XX:+UseCompressedStrings -Xshare:dump
...
>java -XX:+UseCompressedStrings -Xshare:on -version
Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
        at java.lang.Runtime.loadLibrary0(Runtime.java:819)
        at java.lang.System.loadLibrary(System.java:1028)
        at java.lang.System.initializeSystemClass(System.java:1086)
Caused by: java.lang.NullPointerException
        at java.io.UnixFileSystem.<init>(UnixFileSystem.java:21)
        at java.io.FileSystem.getFileSystem(Native Method)
        at java.io.File.<clinit>(File.java:127)
        at java.lang.Runtime.loadLibrary0(Runtime.java:819)
        at java.lang.System.loadLibrary(System.java:1028)
        at java.lang.System.initializeSystemClass(System.java:1086)

Issue introduced in jdk 6u23p-b03. It was found during jdk 6u35-b03 testing.

Comments
Verified 6u60 b01 Windows 7
17-06-2013

Fix: Disable UseCompressedStrings if shared class data is requested, and emit a warning. This is already done for other flags, such as UseCompressedOops and UseLargePages.
30-10-2012

I see three different combinations of class data sharing here that does not work. The combinations and reasons for them not working are: 1) Dump without compressed strings, run with them: Using compressed strings prepends jre/lib/alt-string.jar to the boot classpath. Dumped classpath and expected classpath differs. 2) Dump with compressed strings, run without them: Same as 1), dumped and expected classpath differs. Also has the same problem as 3). 3) Dump and run with compressed strings: Not sure why this does not work, but on fastdebug builds of 6u33 and later trying to dump shared class data with compressed strings fails with the following assert: # Internal Error (/BUILD_AREA/jdk6_33/hotspot/src/share/vm/memory/dump.cpp:89), pid=26383, tid=139893154334464 # assert(typeArrayKlass::cast(value->klass())->element_type() == T_CHAR) failed: compressed string This means we are running in to code that is known to not work with compressed strings.
25-10-2012