RFR: 8372685: C2 SuperWord: wrong requires in test after JDK-8371146

Emanuel Peter epeter at openjdk.org
Thu Nov 27 15:46:46 UTC 2025


On Thu, 27 Nov 2025 15:21:22 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> @MBaesken Reported this issue on windows:
>> 
>> TestAliasingCheckPreLimitNotAvailable_all-flags-fixed-stress-seed.jtr and TestAliasingCheckPreLimitNotAvailable_all-flags-no-stress-seed.jtr show failures on WIndows :
>> 
>> [0.095s][error][gc] Failed to lookup symbol: VirtualAlloc2
>> Error occurred during initialization of VM
>> ZGC requires Windows version 1803 or later
>> 
>> AIX fails too :
>> Error occurred during initialization of VM
>> Option -XX:+UseZGC not supported
>> 
>> 
>> I learned a small lesson here: `@requires vm.gc.Z` is much smarter than checking that no other GC is set, or ZGC is set. It also checks if ZGC is available, which is not always the case, e.g. on the reported Windows machne.
>> 
>> @MBaesken Can you please confirm that this fixes the test for you?
>
>> ZGC requires Windows version 1803 or later
> 
> Maybe this can be improved to something like  'ZGC requires Windows 10 version 1803, Windows 11 or Windows server 2019 or later'  .
> In fact, not all Windows server 2016 have VirtualAlloc2  (see also this discussion  https://github.com/microsoft/ebpf-for-windows/issues/704 ) .
> Our test machine with Windows server 2016  generated the error above .
> 
> Unfortunately MS claims here
> https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc2
> Windows 10 [desktop apps only] / Windows Server 2016 [desktop apps only]
> without stating any OS versions.

@MBaesken Thanks for the additional information!

I leave it up to you if you want to file an RFE for the error message. I don't have the expertise on Windows nor on GC.

Can you confirm that this change fixes your issue though? Because I could not reproduce the issue on my machine, so I'm relying on you here ;)

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

PR Comment: https://git.openjdk.org/jdk/pull/28537#issuecomment-3586520805


More information about the hotspot-compiler-dev mailing list