Skip to content

Commit 5eeb41a

Browse files
committed
8293563: [macos-aarch64] SA core file tests failing with sun.jvm.hotspot.oops.UnknownOopException
Reviewed-by: lucy Backport-of: 76f1865124025ee6f788a50e1377b82fd577548f
1 parent 748ccc5 commit 5eeb41a

File tree

7 files changed

+27
-15
lines changed

7 files changed

+27
-15
lines changed

test/hotspot/jtreg/ProblemList.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.j
116116
serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 windows-all
117117
serviceability/dcmd/gc/RunFinalizationTest.java 8227120 linux-all,windows-x64
118118

119-
serviceability/sa/ClhsdbCDSCore.java 8294316,8269982,8267433 macosx-aarch64,macosx-x64
120-
serviceability/sa/ClhsdbFindPC.java#id1 8294316,8269982,8267433 macosx-aarch64,macosx-x64
121-
serviceability/sa/ClhsdbFindPC.java#id3 8294316,8269982,8267433 macosx-aarch64,macosx-x64
122-
serviceability/sa/ClhsdbPmap.java#id1 8294316,8269982,8267433 macosx-aarch64,macosx-x64
123-
serviceability/sa/ClhsdbPstack.java#id1 8294316,8269982,8267433 macosx-aarch64,macosx-x64
124-
serviceability/sa/TestJmapCore.java 8294316,8269982,8267433 macosx-aarch64,macosx-x64
125-
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8269982,8267433 macosx-aarch64,macosx-x64
119+
serviceability/sa/ClhsdbCDSCore.java 8294316,8267433 macosx-x64
120+
serviceability/sa/ClhsdbFindPC.java#id1 8294316,8267433 macosx-x64
121+
serviceability/sa/ClhsdbFindPC.java#id3 8294316,8267433 macosx-x64
122+
serviceability/sa/ClhsdbPmap.java#id1 8294316,8267433 macosx-x64
123+
serviceability/sa/ClhsdbPstack.java#id1 8294316,8267433 macosx-x64
124+
serviceability/sa/TestJmapCore.java 8294316,8267433 macosx-x64
125+
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8267433 macosx-x64
126126

127127
#############################################################################
128128

test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -82,6 +82,7 @@ public static void main(String[] args) throws Exception {
8282
"-Xshare:auto",
8383
"-XX:+ProfileInterpreter",
8484
"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
85+
CoreUtils.getAlwaysPretouchArg(true),
8586
CrashApp.class.getName()
8687
};
8788

test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ private static void testFindPC(boolean withXcomp, boolean withCore) throws Excep
9393
theApp = new LingeredApp();
9494
theApp.setForceCrash(withCore);
9595
if (withXcomp) {
96-
LingeredApp.startApp(theApp, "-Xcomp");
96+
LingeredApp.startApp(theApp, "-Xcomp", CoreUtils.getAlwaysPretouchArg(withCore));
9797
} else {
98-
LingeredApp.startApp(theApp, "-Xint");
98+
LingeredApp.startApp(theApp, "-Xint", CoreUtils.getAlwaysPretouchArg(withCore));
9999
}
100100
System.out.print("Started LingeredApp ");
101101
if (withXcomp) {

test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception {
6060
ClhsdbLauncher test = new ClhsdbLauncher();
6161
theApp = new LingeredApp();
6262
theApp.setForceCrash(withCore);
63-
LingeredApp.startApp(theApp);
63+
LingeredApp.startApp(theApp, CoreUtils.getAlwaysPretouchArg(withCore));
6464
System.out.println("Started LingeredApp with pid " + theApp.getPid());
6565

6666
if (withCore) {

test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception {
6060
ClhsdbLauncher test = new ClhsdbLauncher();
6161
theApp = new LingeredApp();
6262
theApp.setForceCrash(withCore);
63-
LingeredApp.startApp(theApp);
63+
LingeredApp.startApp(theApp, CoreUtils.getAlwaysPretouchArg(withCore));
6464
System.out.println("Started LingeredApp with pid " + theApp.getPid());
6565

6666
if (withCore) {

test/hotspot/jtreg/serviceability/sa/TestJmapCore.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -75,6 +75,7 @@ static void test(String type) throws Throwable {
7575
"-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError",
7676
// The test loads lots of small classes to exhaust Metaspace, skip method
7777
// dependency verification to improve performance in debug builds.
78+
CoreUtils.getAlwaysPretouchArg(true),
7879
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "--show-version",
7980
TestJmapCore.class.getName(), type);
8081

test/lib/jdk/test/lib/util/CoreUtils.java

+10
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,14 @@ private static void unzipCores(File dir) {
258258
}
259259
}
260260

261+
public static String getAlwaysPretouchArg(boolean withCore) {
262+
// macosx-aarch64 has an issue where sometimes the java heap will not be dumped to the
263+
// core file. Using -XX:+AlwaysPreTouch fixes the problem.
264+
if (withCore && Platform.isOSX() && Platform.isAArch64()) {
265+
return "-XX:+AlwaysPreTouch";
266+
} else {
267+
return "-XX:-AlwaysPreTouch";
268+
}
269+
}
270+
261271
}

0 commit comments

Comments
 (0)