Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8187348

Do not abort CDS archive creation when some classes are unverifiable

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 10
    • hotspot
    • None
    • behavioral
    • minimal
    • Some user scripts may expect dumping to fail when unverifiable classes are present. However, it's questionable whether such behavior has any practical benefits.
    • add/remove/modify command line option
    • JDK

      Summary

      Deprecate the IgnoreUnverifiableClassesDuringDump diagnostic vm option in JDK10.

      Change the default boolean value of the IgnoreUnverifiableClassesDuringDump vm option from 'false' to 'true'.

      Problem

      Existing big applications, such as the WLS (WebLogic Server), comprises of jar files which contains legacy classes with classfile version < JDK 1.5. Those classes cannot be verified during CDS dumping. Currently, CDS dumping will exit if there exists any classes which cannot be verified. Some of those classes may exist in only binary form and recompiling them with a newer version of JDK may not be possible. In the ease of use point of view, the CDS dumping should not exit when it encounters unverifiable classes but should ignore those classes and not including those classes in the shared archive.

      Solution

      Currently, there's a way to ignore unverifiable classes during CDS dumping by using the following vm options:

      -XX:+UnlockDiagnosticVMOptions, -XX:+IgnoreUnverifiableClassesDuringDump

      Note that the UnlockDiagnosticVMOptions is required because the IgnoreUnverifiableClassesDuringDump is a diagnostic vm option.

      The proposed solution is to enable the IgnoreUnverifiableClassesDuringDump option by default.

      Specification

      diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp
      --- a/src/share/vm/runtime/globals.hpp
      +++ b/src/share/vm/runtime/globals.hpp
      @@ -3934,7 +3934,7 @@
                 "Average number of symbols per bucket in shared table")           \
                 range(2, 246)                                                     \
                                                                                   \
      -  diagnostic(bool, IgnoreUnverifiableClassesDuringDump, false,              \
      +  diagnostic(bool, IgnoreUnverifiableClassesDuringDump, true,              \
                 "Do not quit -Xshare:dump even if we encounter unverifiable "     \
                 "classes. Just exclude them from the shared dictionary.")         \
                                                                                   \
      
      diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp
      --- a/src/share/vm/runtime/arguments.cpp
      +++ b/src/share/vm/runtime/arguments.cpp
      @@ -381,6 +381,7 @@
         { "MaxRAMFraction",               JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },
         { "MinRAMFraction",               JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },
         { "InitialRAMFraction",           JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },
      +  { "IgnoreUnverifiableClassesDuringDump", JDK_Version::jdk(10),  JDK_Version::undefined(), JDK_Version::undefined() },

            ccheung Calvin Cheung
            iklam Ioi Lam
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: