8374343: Fix SIGSEGV when lib/modules is unreadable

This commit is contained in:
Boris Ulasevich 2025-12-24 13:00:27 -03:00
parent d34ef196c2
commit f3da8c8267

View File

@ -965,7 +965,12 @@ bool AOTClassLocationConfig::validate(const char* cache_filename, bool has_aot_l
log_locations(cache_filename, /*is_write=*/false);
const char* jrt = ClassLoader::get_jrt_entry()->name();
ClassPathEntry* jrt_entry = ClassLoader::get_jrt_entry();
if (jrt_entry == nullptr) {
log_warning(class, path)("Runtime image (modules) is unreadable or missing - validation failed");
return false;
}
const char* jrt = jrt_entry->name();
log_info(class, path)("Checking [0] (modules image)");
bool success = class_location_at(0)->check(jrt, has_aot_linked_classes);
log_info(class, path)("Modules image %s validation: %s", jrt, success ? "passed" : "failed");