RFR(s) 8221351 Crash in KlassFactory::check_shared_class_file_load_hook

Ioi Lam ioi.lam at oracle.com
Tue Mar 26 18:26:47 UTC 2019


The crash happens when we try to read the classfile data for the shared
class java.sql.SQLException. This ultimately goes to
ClassPathImageEntry::open_stream, which calls JImageFindResource.

However, JImageFindResource needs to know the module_name ("java.sql")
for this class, but the module_name look up is done only using the boot
loader, which doesn't know about the java.sql module, which is loaded by the
built-in platform loader.

The fix is to pass the defining class loader down to
ClassPathImageEntry::open_stream_for_loader, so that the module_name look-up
can be done using the correct loader.

While fixing this, I also removed an obsolete "#if INCLUDE_CDS" in
classLoader.cpp. This was relic from the days when we still used the boot
loader to load platform/app classes. This code is no longer needed after
JDK-8186842 (Use Java class loaders for creating the CDS archive).

Tested with tier-{1,2,3}

- Ioi

More information about the hotspot-runtime-dev mailing list