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.
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.
- relates to
-
JDK-8304147 JVM crash during shutdown when dumping dynamic archive
-
- Resolved
-
-
JDK-8306289 32-bit build failures after JDK-8303422
-
- Resolved
-
-
JDK-8306580 Propagate CDS dumping errors instead of directly exiting the VM
-
- Resolved
-