1.1 --- a/src/share/vm/classfile/systemDictionary.cpp Mon Sep 10 16:19:47 2018 +0100 1.2 +++ b/src/share/vm/classfile/systemDictionary.cpp Wed Sep 12 10:11:31 2018 -0400 1.3 @@ -816,7 +816,16 @@ 1.4 check_constraints(d_index, d_hash, k, class_loader, false, THREAD); 1.5 1.6 // Need to check for a PENDING_EXCEPTION again; check_constraints 1.7 - // can throw and doesn't use the CHECK macro. 1.8 + // can throw but we may have to remove entry from the placeholder table below. 1.9 + if (!HAS_PENDING_EXCEPTION) { 1.10 + // Record dependency for non-parent delegation. 1.11 + // This recording keeps the defining class loader of the klass (k) found 1.12 + // from being unloaded while the initiating class loader is loaded 1.13 + // even if the reference to the defining class loader is dropped 1.14 + // before references to the initiating class loader. 1.15 + loader_data->record_dependency(k(), THREAD); 1.16 + } 1.17 + 1.18 if (!HAS_PENDING_EXCEPTION) { 1.19 { // Grabbing the Compile_lock prevents systemDictionary updates 1.20 // during compilations.