RFR: 8360048: NMT crash in gtest/NMTGtests.java: fatal error: NMT corruption: Block at 0x0000017748307120: header canary broken [v2]
Aleksey Shipilev
shade at openjdk.org
Tue Jul 15 08:31:47 UTC 2025
On Mon, 14 Jul 2025 20:56:16 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> This is a clone of https://github.com/openjdk/jdk/pull/25950 that we need to get integrated ASAP.
>>
>> ---
>>
>> 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.
>>
>> ---
>>
>> I'm re-testing with tiers 1-4
>
> David Holmes has updated the pull request incrementally with two additional commits since the last revision:
>
> - Update test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp
>
> Co-authored-by: Aleksey Shipilëv <shipilev at amazon.de>
> - Update src/hotspot/share/nmt/virtualMemoryTracker.cpp
>
> Co-authored-by: Aleksey Shipilëv <shipilev at amazon.de>
So replacing the uses of (sigleton, shared) `VirtualMemoryTracker::Instance` with local `VirtualMemoryTracker vmt(true);` dodges the locking issue, right?
What confuses me in this patch is why are we doing replacements like:
- site->commit_memory(rgn->committed_size());
+ site->commit_memory(VirtualMemoryTracker::Instance::committed_size(rgn));
Doesn't that introduce dependencies on that singleton instance? Can you confirm that is sane?
-------------
PR Review: https://git.openjdk.org/jdk/pull/26284#pullrequestreview-3019298822
More information about the hotspot-runtime-dev
mailing list