RFR: 8301876: Crash in DumpTimeClassInfo::add_verification_constraint

Ioi Lam iklam at openjdk.org
Wed Feb 8 07:35:16 UTC 2023


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` .

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

Commit messages:
 - 8301876: Crash in DumpTimeClassInfo::add_verification_constraint

Changes: https://git.openjdk.org/jdk/pull/12467/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12467&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8301876
  Stats: 5 lines in 1 file changed: 0 ins; 2 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/12467.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12467/head:pull/12467

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


More information about the hotspot-runtime-dev mailing list