Skip to content

8359959: Test runtime/NMT/VirtualAllocTestType.java failed: '\\[0x[0]*7f7dc4043000 - 0x[0]*7f7dc4083000\\] reserved 256KB for Test' missing from stdout/stderr #25894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64
runtime/StackGuardPages/TestStackGuardPagesNative.java 8303612 linux-all
runtime/ErrorHandling/MachCodeFramesInErrorFile.java 8313315 linux-ppc64le
runtime/NMT/VirtualAllocCommitMerge.java 8309698 linux-s390x
runtime/NMT/VirtualAllocTestType.java 8359959 generic-all

applications/jcstress/copy.java 8229852 linux-all

Expand Down
27 changes: 21 additions & 6 deletions test/hotspot/jtreg/runtime/NMT/VirtualAllocTestType.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,12 +61,27 @@ public static void main(String args[]) throws Exception {
addr2 = wb.NMTReserveMemory(reserveSize);
info = "reserve 2: addr2=" + addr2;

// If the second mapping happens to be adjacent to the first mapping, reserve another mapping and release the second mapping; for
// this test, we want to see two disjunct mappings.
if (addr2 == addr1 + reserveSize) {
// For this test, we want to see two disjunct mappings.
if ((addr2 == addr1 + reserveSize) || (addr2 == addr1 - reserveSize)) {
// <---r1---><---r2--->...<---tmp--->
// <---tmp--->...<---r1---><---r2--->
//
// Reserve a new region and find whether r1 or r2 to be released.
long tmp = wb.NMTReserveMemory(reserveSize);
wb.NMTReleaseMemory(addr2, reserveSize);
addr2 = tmp;
long r1 = addr1 < addr2 ? addr1 : addr2;
long r2 = addr1 > addr2 ? addr1 : addr2;
long tmp_end = tmp + reserveSize;
long r1_end = r1 + reserveSize;
long r2_end = r2 + reserveSize;
if (tmp >= r2_end) {
wb.NMTReleaseMemory(r2, reserveSize);
addr1 = r1;
addr2 = tmp;
} else if (tmp_end <= r1) {
wb.NMTReleaseMemory(r1, reserveSize);
addr1 = tmp;
addr2 = r2;
}
}

output = NMTTestUtils.startJcmdVMNativeMemoryDetail();
Expand Down