RFR: 8263567: gtests don't terminate the VM safely
David Holmes
dholmes at openjdk.java.net
Fri Aug 6 04:29:30 UTC 2021
On Wed, 4 Aug 2021 07:04:17 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Please review this fix to shutdown cleanly any JVMs created by gtests that aren't aborted.
>>
>> Testing:
>> - manual instrumentation to check all JVM construction and then deletion during gtest runs
>> - local gtest testing
>> - tiers 1-3 gtest testing
>>
>> Thanks,
>> David
>
> test/hotspot/gtest/gtestMain.cpp line 127:
>
>> 125: if (!_is_initialized && is_same_vm_test(name)) {
>> 126: // we want to have hs_err and core files when we execute regular tests
>> 127: int ret_val = init_jvm(_argc, _argv, false, &jvm);
>
> init_jvm should just return the JavaVM pointer instead of a (rather boolean) int. The result int does not carry any information beyond "success". We can do the same with != NULL.
I think the right thing to do is to report the JNI error that gets returned.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4986
More information about the hotspot-runtime-dev
mailing list