Skip to content
Permalink
Browse files
8274338: com/sun/jdi/RedefineCrossEvent.java failed "assert(m != __nu…
…ll) failed: NULL mirror"

Backport-of: 172aed1a2d75756b140cb723133ac5fb67f7745e
  • Loading branch information
zhengyu123 committed Nov 5, 2021
1 parent e160532 commit 6c86a4176bbd4dd5624d5a3f51c86c561dd76232
Showing with 6 additions and 0 deletions.
  1. +3 −0 src/hotspot/share/classfile/classLoaderData.cpp
  2. +3 −0 src/hotspot/share/oops/instanceKlass.cpp
@@ -353,6 +353,9 @@ void ClassLoaderData::methods_do(void f(Method*)) {
}

void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) {
// To call this, one must have the MultiArray_lock held, but the _klasses list still has lock free reads.
assert_locked_or_safepoint(MultiArray_lock);

// Lock-free access requires load_acquire
for (Klass* k = Atomic::load_acquire(&_klasses); k != NULL; k = k->next_link()) {
// Do not filter ArrayKlass oops here...
@@ -2525,6 +2525,9 @@ void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handl
constants()->restore_unshareable_info(CHECK);

if (array_klasses() != NULL) {
// To get a consistent list of classes we need MultiArray_lock to ensure
// array classes aren't observed while they are being restored.
MutexLocker ml(MultiArray_lock);
// Array classes have null protection domain.
// --> see ArrayKlass::complete_create_array_klass()
array_klasses()->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK);

1 comment on commit 6c86a41

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 6c86a41 Nov 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.