RFR: 8301876: Crash in DumpTimeClassInfo::add_verification_constraint

Ioi Lam iklam at openjdk.org
Thu Feb 9 00:33:53 UTC 2023


On Wed, 8 Feb 2023 16:56:30 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> When dumping the a dynamic CDS archive, we clone and restore the `SystemDictionaryShared::_dumptime_table` (see [JDK-8264735](https://bugs.openjdk.org/browse/JDK-8264735).)
>> 
>> The bug is that for generated classes such as ` jdk/proxy2/$Proxy16` that are excluded from the CDS dump, we incorrectly remove their `DumpTimeClassInfo` from the `_dumptime_table` clone. After the dynamic archive has finished dumping, there's a very small window of time where some Java code would be executed and cause ` jdk/proxy2/$Proxy16` to be verified. This will cause the following crash because we can't find a `DumpTimeClassInfo` for this class. 
>> 
>> 
>> DumpTimeSharedClassTable::get_info()
>> SystemDictionaryShared::get_info()
>> SystemDictionaryShared::add_verification_constraint()
>> VerificationType::is_reference_assignable_from()
>> ClassVerifier::verify_exception_handler_table()
>> ClassVerifier::verify_method()
>> ClassVerifier::verify_class()
>> Verifier::verify()
>> InstanceKlass::link_class_impl() -- for  jdk/proxy2/$Proxy16
>> 
>> 
>> The fix is simple -- always copy all  `DumpTimeClassInfo` when cloning  `_dumptime_table` .
>
> LGTM

Thanks @calvinccheung and @matias9927 for the review.

Passed tiers 1-4. The "Netty" test that I added (in closed repo) executed more than 20 times (on various platforms, 10 iterations each) without crashing.

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

PR: https://git.openjdk.org/jdk/pull/12467


More information about the hotspot-runtime-dev mailing list