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

Use common functions to exit the VM for -Xshare:dump and CDS errors

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • hotspot
    • b19

      When running in -Xshare:dump mode, we need to exit the VM process in a special way

      One example is here:
      https://github.com/openjdk/jdk/blob/1fdaf252b6375773072e665fd5d4cfb509e98f4c/src/hotspot/share/cds/metaspaceShared.cpp#L567-L571

        // There may be pending VM operations. We have changed some global states
        // (such as vmClasses::_klasses) that may cause these VM operations
        // to fail. For safety, forget these operations and exit the VM directly.
        os::_exit(0);

      But there are also other calls to exit the VM when an unrecoverable error happens during CDS archive dumping and loading. Currently, we have ad-hoc calls to os::_exit(0), vm_exit_during_initialization() and vm_direct_exit().

      We should change all such calls to a few utility functions (used under different situations) with proper documentation.

            matsaave Matias Saavedra Silva
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: