Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8335735 jruby -J-XX:CacheDataStore=jruby.cds crashes due to lack of module support
  3. JDK-8336562

Quit CacheDataStore creation when incompatible module options are specified

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • hotspot

      For the Leyden EA, if you dump the CacheDataStore with an incompatible module option, such as --module-path, the dumping operation will continue and *sometimes* mysteriously fail. See JDK-8335735

      This fix will quit the VM early and print an explanation message:

      $ rm -f hw.cds
      $ java --module-path=foo.jar -cp /home/iklam/tmp/HelloWorld.jar -XX:CacheDataStore=hw.cds HelloWorld
      [0.000s][warning][cds] optimized module handling/full module graph: disabled due to incompatible property: jdk.module.path=foo.jar
      Error occurred during initialization of VM
      CacheDataStore cannot be created because PreloadSharedClasses is enabled but full module graph is disabled


      or


      $ ~/Downloads/ruby/jruby-9.4.8.0/bin/jruby -J-XX:CacheDataStore=jruby.cds -e '10.times { org.jruby.Ruby.newInstance }'
      [0.000s][warning][cds] optimized module handling/full module graph: disabled due to incompatible property: jdk.module.addopens=java.base/java.io=org.jruby.dist
      Error occurred during initialization of VM
      CacheDataStore cannot be created because PreloadSharedClasses is enabled but full module graph is disabled

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: