RFR: 8278602: CDS dynamic dump may access unloaded classes [v3]

Coleen Phillimore coleenp at openjdk.java.net
Fri Dec 17 16:26:22 UTC 2021


On Thu, 16 Dec 2021 23:50:57 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/cds/dumpTimeClassInfo.inline.hpp line 58:
>> 
>>> 56:       return result;
>>> 57:     } else {
>>> 58:       if (!SystemDictionaryShared::is_excluded_class(k)) {
>> 
>> I thought this was the original bug?  is_excluded_class() looks at mirror->signers() which if the class isn't alive, mirror->signers() will crash.  This has to be in the k->is_loader_alive() too.
>
> is_excluded_class() only checks the DumpTimeClassInfo::_is_excluded field. It doesn't examine the mirror->signers(). The crash happened with SystemDictionaryShared::check_excluded_classes(), which does examine the signers.
> 
> 
> bool SystemDictionaryShared::is_excluded_class(InstanceKlass* k) {
>   assert(_no_class_loading_should_happen, "sanity");
>   assert_lock_strong(DumpTimeTable_lock);
>   Arguments::assert_is_dumping_archive();
>   DumpTimeClassInfo* p = find_or_allocate_info_for_locked(k);
>   return (p == NULL) ? true : p->is_excluded();
> }

Ok, sorry I got the names confused.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6859


More information about the hotspot-dev mailing list