RFR: 8301876: Crash in DumpTimeClassInfo::add_verification_constraint
Matias Saavedra Silva
matsaave at openjdk.org
Wed Feb 8 22:45:42 UTC 2023
On Wed, 8 Feb 2023 07:26:13 GMT, Ioi Lam <iklam 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` .
Nice and simple, LGTM!
-------------
Marked as reviewed by matsaave (Author).
PR: https://git.openjdk.org/jdk/pull/12467
More information about the hotspot-runtime-dev
mailing list