RFR: 8360164: AOT cache creation crashes in ~ThreadTotalCPUTimeClosure() [v3]
David Holmes
dholmes at openjdk.org
Mon Jun 30 06:42:38 UTC 2025
On Fri, 27 Jun 2025 16:19:18 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> `java -XX:AOTMode=create` calls `vm_exit(0)` to terminate the JVM (see [this e-mail thread](https://mail.openjdk.org/pipermail/hotspot-runtime-dev/2024-August/072122.html) for the reason for doing so). However, at this point, the JVM has executed quite a lot of Java code and there are many threads in the JVM that would require a proper shutdown. See [comments by @kimbarrett](https://bugs.openjdk.org/browse/JDK-8360164?focusedId=14792754&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14792754) for a detailed analysis.
>>
>> This fix calls `JVM_Halt(0)` instead of `vm_exit(0)` so that the proper shutdown code is executed.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>
> Use vm_direct_exit instead, as at this point we have not finished Threads::create_vm() yet, so we may not have done all the initialization to be able to call before_exit()
Okay so the proposal now is that instead of trying to do a more "refined" termination process by calling `before_exit` etc (which is problematic because we are only partly initialized), we instead do a more abrupt termination by using `vm_direct_exit`.
This seems "safe" with regards to the issues Kim was commenting on.
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26008#pullrequestreview-2970072112
More information about the hotspot-runtime-dev
mailing list