RFR: 8308764: Reporting errors from create_vm may crash [v5]
Kim Barrett
kbarrett at openjdk.org
Tue Jun 6 15:19:55 UTC 2023
On Tue, 6 Jun 2023 15:14:58 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Also init_globals2 should have a better name, like init_objects_and_globals() or something like that. But that's not this issue.
>
> I was later wondering the same thing. Here's my rationale for putting it here
> instead of in the JNI code (i.e. agreeing with Coleen's suggestion).
>
> I think neither place is really correct. Failure to create and initialize the
> VM ought to always propogate out to the JNI client to decide what to do about
> the failure. But we don't do that, not only here but all over the place. These
> (and many other) failures are treated as grounds for terminating the process
> containing the VM, regardless of what else that process might be doing. This
> limits the utility of the VM in ways similar to not being able to have
> multiple VMs (at the same time or serially) in one process. Oh well.
>
> Given that, putting the vm_exit_during_initialization() in create_vm seems
> simpler. It's not even clear create_vm should ever return failure with
> canTryAgain false; maybe it should always terminate if there's a non-retryable
> failure. But perhaps that's for a later day.
I agree that init_globals2 isn't a great name. I failed to come up with
something better, either now or when I added it. Anyone with something better
should go for it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14238#discussion_r1219840524
More information about the hotspot-runtime-dev
mailing list