Skip to content

Commit 4202063

Browse files
committed
8293563: [macos-aarch64] SA core file tests failing with sun.jvm.hotspot.oops.UnknownOopException
Reviewed-by: mbaesken Backport-of: 5eeb41a7294f56bc258a154c043bc540cb8de5c4
1 parent b7822c3 commit 4202063

File tree

7 files changed

+26
-12
lines changed

7 files changed

+26
-12
lines changed

test/hotspot/jtreg/ProblemList.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ serviceability/sa/ClhsdbJdis.java 8193639 solaris-all
174174
serviceability/sa/ClhsdbJhisto.java 8193639,8211767 solaris-all,linux-ppc64le,linux-ppc64
175175
serviceability/sa/ClhsdbJstack.java 8193639 solaris-all
176176
serviceability/sa/ClhsdbLongConstant.java 8193639 solaris-all
177-
serviceability/sa/ClhsdbPmap.java 8269982,8294316,8193639,8211767,8267433 solaris-all,linux-ppc64le,linux-ppc64,macosx-aarch64,macosx-x64
177+
serviceability/sa/ClhsdbPmap.java 8294316,8193639,8211767,8267433 solaris-all,linux-ppc64le,linux-ppc64,macosx-x64
178178
serviceability/sa/ClhsdbPrintAll.java 8193639 solaris-all
179179
serviceability/sa/ClhsdbPrintAs.java 8193639 solaris-all
180180
serviceability/sa/ClhsdbPrintStatics.java 8193639 solaris-all
@@ -202,8 +202,8 @@ serviceability/sa/TestInstanceKlassSize.java 8193639 solaris-all
202202
serviceability/sa/TestInstanceKlassSizeForInterface.java 8193639 solaris-all
203203
serviceability/sa/TestIntConstant.java 8193639,8211767 solaris-all,linux-ppc64le,linux-ppc64
204204
serviceability/sa/TestJhsdbJstackLock.java 8193639 solaris-all
205-
serviceability/sa/TestJmapCore.java 8269982,8294316,8193639,8267433 solaris-all,macosx-aarch64,macosx-x64
206-
serviceability/sa/TestJmapCoreMetaspace.java 8269982,8294316,8193639,8267433 solaris-all,macosx-aarch64,macosx-x64
205+
serviceability/sa/TestJmapCore.java 8294316,8193639,8267433 solaris-all,macosx-x64
206+
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8193639,8267433 solaris-all,macosx-x64
207207
serviceability/sa/TestPrintMdo.java 8193639 solaris-all
208208
serviceability/sa/TestRevPtrsForInvokeDynamic.java 8191270 generic-all
209209
serviceability/sa/TestType.java 8193639 solaris-all

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, 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
@@ -79,6 +79,7 @@ public static void main(String[] args) throws Exception {
7979
"-Xshare:auto",
8080
"-XX:+ProfileInterpreter",
8181
"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
82+
CoreUtils.getAlwaysPretouchArg(true),
8283
CrashApp.class.getName()
8384
};
8485

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ private static void testFindPC(boolean withXcomp, boolean withCore) throws Excep
8585
theApp = new LingeredAppWithTrivialMain();
8686
theApp.setForceCrash(withCore);
8787
if (withXcomp) {
88-
LingeredApp.startApp(List.of("-Xcomp"), theApp);
88+
LingeredApp.startApp(List.of("-Xcomp", CoreUtils.getAlwaysPretouchArg(withCore)), theApp);
8989
} else {
90-
LingeredApp.startApp(List.of("-Xint"), theApp);
90+
LingeredApp.startApp(List.of("-Xint", CoreUtils.getAlwaysPretouchArg(withCore)), theApp);
9191
}
9292
System.out.print("Started LingeredApp ");
9393
if (withXcomp) {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, 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
@@ -26,6 +26,7 @@
2626
import java.util.Map;
2727

2828
import jdk.test.lib.apps.LingeredApp;
29+
import jdk.test.lib.util.CoreUtils;
2930
import jtreg.SkippedException;
3031

3132
/**
@@ -46,7 +47,7 @@ public static void main(String[] args) throws Exception {
4647
LingeredApp theApp = null;
4748
try {
4849
ClhsdbLauncher test = new ClhsdbLauncher();
49-
theApp = LingeredApp.startApp();
50+
theApp = LingeredApp.startApp(List.of(CoreUtils.getAlwaysPretouchArg(false)));
5051
System.out.println("Started LingeredApp with pid " + theApp.getPid());
5152

5253
List<String> cmds = List.of("pmap");

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, 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
@@ -26,6 +26,7 @@
2626
import java.util.Map;
2727

2828
import jdk.test.lib.apps.LingeredApp;
29+
import jdk.test.lib.util.CoreUtils;
2930
import jtreg.SkippedException;
3031

3132
/**
@@ -45,7 +46,7 @@ public static void main(String[] args) throws Exception {
4546
LingeredApp theApp = null;
4647
try {
4748
ClhsdbLauncher test = new ClhsdbLauncher();
48-
theApp = LingeredApp.startApp();
49+
theApp = LingeredApp.startApp(List.of(CoreUtils.getAlwaysPretouchArg(false)));
4950
System.out.println("Started LingeredApp with pid " + theApp.getPid());
5051

5152
List<String> cmds = List.of("pstack -v");

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 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
@@ -74,6 +74,7 @@ static void test(String type) throws Throwable {
7474
"-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError", "-XX:-TransmitErrorReport",
7575
// The test loads lots of small classes to exhaust Metaspace, skip method
7676
// dependency verification to improve performance in debug builds.
77+
CoreUtils.getAlwaysPretouchArg(true),
7778
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "--show-version",
7879
TestJmapCore.class.getName(), type);
7980

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,14 @@ private static void unzipCores(File dir) {
230230
}
231231
}
232232

233-
}
233+
public static String getAlwaysPretouchArg(boolean withCore) {
234+
// macosx-aarch64 has an issue where sometimes the java heap will not be dumped to the
235+
// core file. Using -XX:+AlwaysPreTouch fixes the problem.
236+
if (withCore && Platform.isOSX() && Platform.isAArch64()) {
237+
return "-XX:+AlwaysPreTouch";
238+
} else {
239+
return "-XX:-AlwaysPreTouch";
240+
}
241+
}
242+
243+
}

0 commit comments

Comments
 (0)