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: mbaesken
Backport-of: 5eeb41a7294f56bc258a154c043bc540cb8de5c4
  • Loading branch information
RealCLanger committed May 7, 2024
1 parent b7822c3 commit 4202063
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 12 deletions.
6 changes: 3 additions & 3 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ serviceability/sa/ClhsdbJdis.java 8193639 solaris-all
serviceability/sa/ClhsdbJhisto.java 8193639,8211767 solaris-all,linux-ppc64le,linux-ppc64
serviceability/sa/ClhsdbJstack.java 8193639 solaris-all
serviceability/sa/ClhsdbLongConstant.java 8193639 solaris-all
serviceability/sa/ClhsdbPmap.java 8269982,8294316,8193639,8211767,8267433 solaris-all,linux-ppc64le,linux-ppc64,macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbPmap.java 8294316,8193639,8211767,8267433 solaris-all,linux-ppc64le,linux-ppc64,macosx-x64
serviceability/sa/ClhsdbPrintAll.java 8193639 solaris-all
serviceability/sa/ClhsdbPrintAs.java 8193639 solaris-all
serviceability/sa/ClhsdbPrintStatics.java 8193639 solaris-all
Expand Down Expand Up @@ -202,8 +202,8 @@ serviceability/sa/TestInstanceKlassSize.java 8193639 solaris-all
serviceability/sa/TestInstanceKlassSizeForInterface.java 8193639 solaris-all
serviceability/sa/TestIntConstant.java 8193639,8211767 solaris-all,linux-ppc64le,linux-ppc64
serviceability/sa/TestJhsdbJstackLock.java 8193639 solaris-all
serviceability/sa/TestJmapCore.java 8269982,8294316,8193639,8267433 solaris-all,macosx-aarch64,macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8269982,8294316,8193639,8267433 solaris-all,macosx-aarch64,macosx-x64
serviceability/sa/TestJmapCore.java 8294316,8193639,8267433 solaris-all,macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8193639,8267433 solaris-all,macosx-x64
serviceability/sa/TestPrintMdo.java 8193639 solaris-all
serviceability/sa/TestRevPtrsForInvokeDynamic.java 8191270 generic-all
serviceability/sa/TestType.java 8193639 solaris-all
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, 2019, 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 @@ -79,6 +79,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 @@ -85,9 +85,9 @@ private static void testFindPC(boolean withXcomp, boolean withCore) throws Excep
theApp = new LingeredAppWithTrivialMain();
theApp.setForceCrash(withCore);
if (withXcomp) {
LingeredApp.startApp(List.of("-Xcomp"), theApp);
LingeredApp.startApp(List.of("-Xcomp", CoreUtils.getAlwaysPretouchArg(withCore)), theApp);
} else {
LingeredApp.startApp(List.of("-Xint"), theApp);
LingeredApp.startApp(List.of("-Xint", CoreUtils.getAlwaysPretouchArg(withCore)), theApp);
}
System.out.print("Started LingeredApp ");
if (withXcomp) {
Expand Down
5 changes: 3 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, 2019, 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 All @@ -26,6 +26,7 @@
import java.util.Map;

import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.util.CoreUtils;
import jtreg.SkippedException;

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

List<String> cmds = List.of("pmap");
Expand Down
5 changes: 3 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, 2019, 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 All @@ -26,6 +26,7 @@
import java.util.Map;

import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.util.CoreUtils;
import jtreg.SkippedException;

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

List<String> cmds = List.of("pstack -v");
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, 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 @@ -74,6 +74,7 @@ static void test(String type) throws Throwable {
"-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError", "-XX:-TransmitErrorReport",
// 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
12 changes: 11 additions & 1 deletion test/lib/jdk/test/lib/util/CoreUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,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 4202063

@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.