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

Martin Doerr mdoerr at openjdk.org
Tue Nov 11 16:12:25 UTC 2025


On Mon, 10 Nov 2025 05:54:02 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> 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
>
> Thanks for the reviews

@xmas92: We have seen an assertion in gtest on Windows:

#  Internal Error (openjdk-jdk-windows_x86_64-dbg\jdk\src\hotspot\cpu\x86\gc/z/zAddress_x86.inline.hpp:35), pid=37128, tid=26420
#  assert(index == 0 || is_power_of_2(index)) failed: Incorrect load shift: 15

Is this related to this change or one of the other ZGC changes which were pushed on the same date?
I guess we'll need to file a new JBS bug.

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

PR Comment: https://git.openjdk.org/jdk/pull/28159#issuecomment-3517652580


More information about the hotspot-gc-dev mailing list