United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7192322 JVM could not be initialized when class data sharing is enabled and compressed strings are used
JDK-7192322 : JVM could not be initialized when class data sharing is enabled and compressed strings are used

Details
Type:
Bug
Submit Date:
2012-08-17
Status:
Closed
Updated Date:
2013-06-27
Project Name:
JDK
Resolved Date:
2012-11-30
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u21p
Fixed Versions:
6u60 (b01)

Related Reports
Backport:

Sub Tasks

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
                                     
2013-06-17
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.
                                     
2012-10-25
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.
                                     
2012-10-30
http://closedjdk.us.oracle.com/jdk6u/jdk6u-dev/hotspot/rev/9fb6552c03c1
                                     
2013-05-16



Hardware and Software, Engineered to Work Together