Skip to content

Commit 76f1865

Browse files
committed
8293563: [macos-aarch64] SA core file tests failing with sun.jvm.hotspot.oops.UnknownOopException
Reviewed-by: sspitsyn, kevinw
1 parent 9db95ed commit 76f1865

File tree

7 files changed

+28
-15
lines changed

7 files changed

+28
-15
lines changed

test/hotspot/jtreg/ProblemList.txt

+8-7
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,14 @@ serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 w
114114
serviceability/jvmti/vthread/GetSetLocalTest/GetSetLocalTest.java 8286836 generic-all
115115
serviceability/dcmd/gc/RunFinalizationTest.java 8227120 linux-all,windows-x64
116116

117-
serviceability/sa/ClhsdbCDSCore.java 8269982,8267433 macosx-aarch64,macosx-x64
118-
serviceability/sa/ClhsdbFindPC.java#xcomp-core 8269982,8267433 macosx-aarch64,macosx-x64
119-
serviceability/sa/ClhsdbFindPC.java#no-xcomp-core 8269982,8267433 macosx-aarch64,macosx-x64
120-
serviceability/sa/ClhsdbPmap.java#core 8269982,8267433 macosx-aarch64,macosx-x64
121-
serviceability/sa/ClhsdbPstack.java#core 8269982,8267433 macosx-aarch64,macosx-x64
122-
serviceability/sa/TestJmapCore.java 8269982,8267433 macosx-aarch64,macosx-x64
123-
serviceability/sa/TestJmapCoreMetaspace.java 8269982,8267433 macosx-aarch64,macosx-x64
117+
serviceability/sa/ClhsdbCDSCore.java 8267433 macosx-x64
118+
serviceability/sa/ClhsdbFindPC.java#xcomp-core 8267433 macosx-x64
119+
serviceability/sa/ClhsdbFindPC.java#no-xcomp-core 8267433 macosx-x64
120+
serviceability/sa/ClhsdbPmap.java#core 8267433 macosx-x64
121+
serviceability/sa/ClhsdbPstack.java#core 8267433 macosx-x64
122+
serviceability/sa/TestJmapCore.java 8267433 macosx-x64
123+
serviceability/sa/TestJmapCoreMetaspace.java 8267433 macosx-x64
124+
124125
serviceability/attach/ConcAttachTest.java 8290043 linux-all
125126

126127
#############################################################################

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
@@ -73,6 +73,7 @@ public static void main(String[] args) throws Throwable {
7373
static void test(String type) throws Throwable {
7474
ProcessBuilder pb = ProcessTools.createTestJvm("-XX:+CreateCoredumpOnCrash",
7575
"-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError",
76+
CoreUtils.getAlwaysPretouchArg(true),
7677
TestJmapCore.class.getName(), type);
7778

7879
// If we are going to force a core dump, apply "ulimit -c unlimited" if we can.

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

+10
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,14 @@ private static void unzipCores(File dir) {
260260
}
261261
}
262262

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

0 commit comments

Comments
 (0)