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

Aleksey Shipilev shade at openjdk.org
Mon Jul 14 15:07:42 UTC 2025


On Mon, 14 Jul 2025 02:53:53 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

Are you accepting nits here? I see other PR was already reviewed.

Really hard to understand where the fix is. Bug synopsis also does not help :) I assume the problem is really in the test?

src/hotspot/share/nmt/virtualMemoryTracker.cpp line 244:

> 242:   address bottom = rmr->base();
> 243:   address top = rmr->end();
> 244:     tree()->visit_committed_regions(*rmr, [&](CommittedMemoryRegion& crgn) {

Looks like this is a correct indent:

Suggestion:

  tree()->visit_committed_regions(*rmr, [&](CommittedMemoryRegion& crgn) {

test/hotspot/gtest/runtime/test_virtualMemoryTracker.cpp line 132:

> 130:       rtree->commit_region(addr + 2 * cs, cs, stack);
> 131:       R r[] = { {addr, 3 * cs} };
> 132:       check(vmt,rmr, r);

Suggestion:

      check(vmt, rmr, r);

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

PR Review: https://git.openjdk.org/jdk/pull/26284#pullrequestreview-3016672212
PR Review Comment: https://git.openjdk.org/jdk/pull/26284#discussion_r2205132744
PR Review Comment: https://git.openjdk.org/jdk/pull/26284#discussion_r2205134570


More information about the hotspot-runtime-dev mailing list