Skip to content

Commit

Permalink
8293563: [macos-aarch64] SA core file tests failing with sun.jvm.hots…
Browse files Browse the repository at this point in the history
…pot.oops.UnknownOopException

Reviewed-by: lucy
Backport-of: 76f1865124025ee6f788a50e1377b82fd577548f
  • Loading branch information
GoeLin committed Oct 25, 2023
1 parent 748ccc5 commit 5eeb41a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
14 changes: 7 additions & 7 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.j
serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 windows-all
serviceability/dcmd/gc/RunFinalizationTest.java 8227120 linux-all,windows-x64

serviceability/sa/ClhsdbCDSCore.java 8294316,8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbFindPC.java#id1 8294316,8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbFindPC.java#id3 8294316,8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbPmap.java#id1 8294316,8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbPstack.java#id1 8294316,8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/TestJmapCore.java 8294316,8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbCDSCore.java 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#id1 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#id3 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbPmap.java#id1 8294316,8267433 macosx-x64
serviceability/sa/ClhsdbPstack.java#id1 8294316,8267433 macosx-x64
serviceability/sa/TestJmapCore.java 8294316,8267433 macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8267433 macosx-x64

#############################################################################

Expand Down
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022, 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 @@ -82,6 +82,7 @@ public static void main(String[] args) throws Exception {
"-Xshare:auto",
"-XX:+ProfileInterpreter",
"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
CoreUtils.getAlwaysPretouchArg(true),
CrashApp.class.getName()
};

Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ private static void testFindPC(boolean withXcomp, boolean withCore) throws Excep
theApp = new LingeredApp();
theApp.setForceCrash(withCore);
if (withXcomp) {
LingeredApp.startApp(theApp, "-Xcomp");
LingeredApp.startApp(theApp, "-Xcomp", CoreUtils.getAlwaysPretouchArg(withCore));
} else {
LingeredApp.startApp(theApp, "-Xint");
LingeredApp.startApp(theApp, "-Xint", CoreUtils.getAlwaysPretouchArg(withCore));
}
System.out.print("Started LingeredApp ");
if (withXcomp) {
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022, 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 @@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception {
ClhsdbLauncher test = new ClhsdbLauncher();
theApp = new LingeredApp();
theApp.setForceCrash(withCore);
LingeredApp.startApp(theApp);
LingeredApp.startApp(theApp, CoreUtils.getAlwaysPretouchArg(withCore));
System.out.println("Started LingeredApp with pid " + theApp.getPid());

if (withCore) {
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022, 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 @@ -60,7 +60,7 @@ public static void main(String[] args) throws Exception {
ClhsdbLauncher test = new ClhsdbLauncher();
theApp = new LingeredApp();
theApp.setForceCrash(withCore);
LingeredApp.startApp(theApp);
LingeredApp.startApp(theApp, CoreUtils.getAlwaysPretouchArg(withCore));
System.out.println("Started LingeredApp with pid " + theApp.getPid());

if (withCore) {
Expand Down
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/serviceability/sa/TestJmapCore.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022, 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 @@ -75,6 +75,7 @@ static void test(String type) throws Throwable {
"-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError",
// The test loads lots of small classes to exhaust Metaspace, skip method
// dependency verification to improve performance in debug builds.
CoreUtils.getAlwaysPretouchArg(true),
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "--show-version",
TestJmapCore.class.getName(), type);

Expand Down
10 changes: 10 additions & 0 deletions test/lib/jdk/test/lib/util/CoreUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,14 @@ private static void unzipCores(File dir) {
}
}

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

}

1 comment on commit 5eeb41a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.