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

Aleksey Shipilev shade at openjdk.org
Thu Oct 19 15:48:12 UTC 2023


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

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

Commit messages:
 - Fix

Changes: https://git.openjdk.org/jdk/pull/16269/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16269&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8318525
  Stats: 16 lines in 1 file changed: 0 ins; 0 del; 16 mod
  Patch: https://git.openjdk.org/jdk/pull/16269.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16269/head:pull/16269

PR: https://git.openjdk.org/jdk/pull/16269


More information about the hotspot-runtime-dev mailing list