RFR: 8360048: NMT crash in gtest/NMTGtests.java: fatal error: NMT corruption: Block at 0x0000017748307120: header canary broken

Johan Sjölen jsjolen at openjdk.org
Tue Jun 24 13:29:30 UTC 2025


On Tue, 24 Jun 2025 13:08:25 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> The canary header test failed since there were concurrent `remove` and `free()` from the tree. The `remove` operations are synch'ed with corresponding NMT lock. The `ReserveMemory::reserve()` uses the same lock internally and is not included in the locked code block.
>> 
>> Tests: tier5 {macosx-aarch64, linux-x64, windows-x64} x {debug, release}
>
> test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp line 452:
> 
>> 450:       MemTracker::NmtVirtualMemoryLocker nvml;
>> 451:       rtree = VirtualMemoryTracker::Instance::tree();
>> 452:       rtree->tree().remove_all();
> 
> I think I asked about this before - can we  do remove_all  in the constructor to avoid this 2 line repeating pattern?
> 
> Otherwise looks good, can you please check the GHA test failures on Windows?

I don't think that's the right way to go. I think it's better if we can avoid using the global instance, and not change the code of the VMT in order to appease the tests.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25950#discussion_r2164009678


More information about the hotspot-runtime-dev mailing list