8209389: SIGSEGV in WalkOopAndArchiveClosure::do_oop_work

Check the MetaspaceShared::archive_heap_object return value and handle failure accordingly.

Reviewed-by: iklam, coleenp
This commit is contained in:
Jiangli Zhou 2018-08-16 17:29:22 -04:00
parent d2a9e11aeb
commit da4684e2e1
5 changed files with 52 additions and 3 deletions

View file

@ -1038,6 +1038,7 @@ void java_lang_Class::archive_basic_type_mirrors(TRAPS) {
if (m != NULL) {
// Update the field at _array_klass_offset to point to the relocated array klass.
oop archived_m = MetaspaceShared::archive_heap_object(m, THREAD);
assert(archived_m != NULL, "sanity");
Klass *ak = (Klass*)(archived_m->metadata_field(_array_klass_offset));
assert(ak != NULL || t == T_VOID, "should not be NULL");
if (ak != NULL) {