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: sspitsyn, kevinw
  • Loading branch information
plummercj committed Sep 28, 2022
1 parent 9db95ed commit 76f1865
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
15 changes: 8 additions & 7 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 w
serviceability/jvmti/vthread/GetSetLocalTest/GetSetLocalTest.java 8286836 generic-all
serviceability/dcmd/gc/RunFinalizationTest.java 8227120 linux-all,windows-x64

serviceability/sa/ClhsdbCDSCore.java 8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbFindPC.java#xcomp-core 8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbFindPC.java#no-xcomp-core 8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbPmap.java#core 8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbPstack.java#core 8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/TestJmapCore.java 8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8269982,8267433 macosx-aarch64,macosx-x64
serviceability/sa/ClhsdbCDSCore.java 8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#xcomp-core 8267433 macosx-x64
serviceability/sa/ClhsdbFindPC.java#no-xcomp-core 8267433 macosx-x64
serviceability/sa/ClhsdbPmap.java#core 8267433 macosx-x64
serviceability/sa/ClhsdbPstack.java#core 8267433 macosx-x64
serviceability/sa/TestJmapCore.java 8267433 macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8267433 macosx-x64

serviceability/attach/ConcAttachTest.java 8290043 linux-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, 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 @@ -73,6 +73,7 @@ public static void main(String[] args) throws Throwable {
static void test(String type) throws Throwable {
ProcessBuilder pb = ProcessTools.createTestJvm("-XX:+CreateCoredumpOnCrash",
"-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError",
CoreUtils.getAlwaysPretouchArg(true),
TestJmapCore.class.getName(), type);

// If we are going to force a core dump, apply "ulimit -c unlimited" if we can.
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 @@ -260,4 +260,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 76f1865

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