RFR: 8371341: ZGC: Improve gtest interoperability with instrumented builds (ASAN)

Axel Boldt-Christmas aboldtch at openjdk.org
Wed Nov 5 19:09:36 UTC 2025


A few ZGC gtest reservers memory in valid ZAddress address ranges to mock and test different sub systems. When running in instrumented builds such as ASAN the address space we try to may be unavailable. This will cause a couple of our tests to fail.

I propose we change all out gtests to do what `test/hotspot/gtest/gc/z/test_zVirtualMemoryManager.cpp` does. Namely uses our `ZVirtualMemoryManager` to reserve the address space and skip the test incase we are not able to reserve an adequate address range to use for the test.

* Testing
  * GHA
  * gtest with and without ASAN, including artificially induced reservation clash with ASAN

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

Commit messages:
 - Improve ZGC gtest interoperability with instrumented builds (ASAN)

Changes: https://git.openjdk.org/jdk/pull/28159/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28159&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371341
  Stats: 138 lines in 5 files changed: 72 ins; 37 del; 29 mod
  Patch: https://git.openjdk.org/jdk/pull/28159.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28159/head:pull/28159

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


More information about the hotspot-gc-dev mailing list