8163406: The fixup_module_list must be protected by Module_lock when inserting new entries

In java_lang_Class::create_mirror, restructure the check for adding a class to the fixup_module_list, guarded by Module_lock.

Reviewed-by: acorn, coleenp, dholmes, zgu
This commit is contained in:
Lois Foltan 2016-09-19 12:04:28 -04:00
parent eb52950704
commit 368585d0db
10 changed files with 75 additions and 45 deletions

View file

@ -2247,8 +2247,8 @@ void InstanceKlass::set_package(ClassLoaderData* loader_data, TRAPS) {
// the java.base module. If a non-java.base package is erroneously placed
// in the java.base module it will be caught later when java.base
// is defined by ModuleEntryTable::verify_javabase_packages check.
assert(ModuleEntryTable::javabase_module() != NULL, "java.base module is NULL");
_package_entry = loader_data->packages()->lookup(pkg_name, ModuleEntryTable::javabase_module());
assert(ModuleEntryTable::javabase_moduleEntry() != NULL, "java.base module is NULL");
_package_entry = loader_data->packages()->lookup(pkg_name, ModuleEntryTable::javabase_moduleEntry());
} else {
assert(loader_data->modules()->unnamed_module() != NULL, "unnamed module is NULL");
_package_entry = loader_data->packages()->lookup(pkg_name,