RFR: 8266576: dynamicArchive/ParallelLambdaLoadTest.java crashes in tier2 testing

David Holmes dholmes at openjdk.java.net
Fri May 7 11:08:53 UTC 2021


On Fri, 7 May 2021 00:08:53 GMT, Yumin Qi <minqi at openjdk.org> wrote:

> Hi, Please review
> 
>   In dynamic dump, the lambda invoker holder classes are regenerated in DynamicArchive::dump, which is after shutdown hook executed. The returned objects from the regeneration may contain invalid contents which caused crash like in this bug. It is late to execute java code, the fix is to move the call into MetaspaceShared::link_and_cleanup_shared_classes which is before shutdown hook, before halt.
>   JDK-8266585 and JDK-8266594 failed in different patterns, could be the same reason.
> 
>   Tests: tier1,tier2
> 
> Thanks
> Yumin

Hi Yumin,

So there are three "exit" paths covered by this:
- System.exit/halt
- last thread terminates VM
- -Xshare:dump

so that seems reasonable.

But I see a pre-existing problem that is now worse with this change. In JavaThread::invoke_shutdown_hooks we have this code:

// We could get here with a pending exception, if so clear it now.
  if (this->has_pending_exception()) {
    this->clear_pending_exception();
  }

but that appears after the call to link_and_cleanup_shared_classes, so if in fact there is a pre-existing exception we will return from link_and_cleanup_shared_classes at the first CHECK (which is now on the newly moved code).

In order to get the current crashes fixed we can address the exception issue in a follow up bug.

Thanks,
David

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

Marked as reviewed by dholmes (Reviewer).

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


More information about the hotspot-runtime-dev mailing list