mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8304147: JVM crash during shutdown when dumping dynamic archive
Reviewed-by: ccheung, matsaave, coleenp
This commit is contained in:
parent
554bccf046
commit
63ce88b5fb
7 changed files with 169 additions and 56 deletions
|
@ -2023,22 +2023,11 @@ bool JavaThread::sleep(jlong millis) {
|
|||
void JavaThread::invoke_shutdown_hooks() {
|
||||
HandleMark hm(this);
|
||||
|
||||
// We could get here with a pending exception, if so clear it now or
|
||||
// it will cause MetaspaceShared::link_shared_classes to
|
||||
// fail for dynamic dump.
|
||||
// We could get here with a pending exception, if so clear it now.
|
||||
if (this->has_pending_exception()) {
|
||||
this->clear_pending_exception();
|
||||
}
|
||||
|
||||
#if INCLUDE_CDS
|
||||
// Link all classes for dynamic CDS dumping before vm exit.
|
||||
// Same operation is being done in JVM_BeforeHalt for handling the
|
||||
// case where the application calls System.exit().
|
||||
if (DynamicArchive::should_dump_at_vm_exit()) {
|
||||
DynamicArchive::prepare_for_dump_at_exit();
|
||||
}
|
||||
#endif
|
||||
|
||||
EXCEPTION_MARK;
|
||||
Klass* shutdown_klass =
|
||||
SystemDictionary::resolve_or_null(vmSymbols::java_lang_Shutdown(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue