RFR: 8304147: JVM crash during shutdown when dumping dynamic archive

David Holmes dholmes at openjdk.org
Wed Mar 22 22:02:44 UTC 2023


On Wed, 22 Mar 2023 21:56:40 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/javaThread.cpp line 2031:
>> 
>>> 2029:   if (this->has_pending_exception()) {
>>> 2030:     this->clear_pending_exception();
>>> 2031:   }
>> 
>> I think the HandleMark can be removed.
>> We may need to move lines 2026 - 2031 to the new `dump_at_exit` function.
>
> Thanks missed that. Not sure how we can get here with a pending exception though:
> 
> DestroyJavaVM()
>   -> Threads::destroy_vm();
>      -> wait till last non-daemon thread
>      -> commit shutdown event
>      -> JavaThread::invoke_shutdown_hooks() 
> 
> There is nowhere for an exception to materialize in this path AFAICS.

Also note no need to move this as the code below clears any pending exception (from running the hooks). If we could get here with an exception pending it would have broken running of the hooks before we even had dynamic archiving.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13134#discussion_r1145451729


More information about the hotspot-runtime-dev mailing list