RFR: 8318525: Atomic gtest should run as TEST_VM to access VM capabilities

Aleksey Shipilev shade at openjdk.org
Fri Oct 20 08:15:37 UTC 2023


On Fri, 20 Oct 2023 07:31:37 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> While doing JDK-8316961, I noticed that atomic tests behave weirdly when executed from gtest. I believe the reason is that tests are running as TEST, not as TEST_VM. So the VM is not initialized, which fails the tests on asserts and/or takes weird paths in the atomic code.
>> 
>> Some Atomic implementations reach to VM_Version for asserts:
>> https://github.com/openjdk/jdk/blob/9cf334fb6488188ea4236e5d156b11245bace88f/src/hotspot/os_cpu/linux_arm/atomic_linux_arm.hpp#L149
>> 
>> Some Atomic implementations reach to StubRoutines for fallbacks:
>> https://github.com/openjdk/jdk/blob/9cf334fb6488188ea4236e5d156b11245bace88f/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp#L520
>> 
>> Additional testing:
>>  - [x] linux-aarch64-server-fastdebug, affected test passes
>>  - [x] linux-arm-server-fastdebug, affected test passes
>
> Marked as reviewed by stefank (Reviewer).

Thanks @stefank! Trivial?

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

PR Comment: https://git.openjdk.org/jdk/pull/16269#issuecomment-1772282139


More information about the hotspot-runtime-dev mailing list