8192897: NPE occurs on clhsdb jstack
Reviewed-by: dholmes, sspitsyn, jgeorge, sballal
This commit is contained in:
parent
a06ef68dcf
commit
b6252a4d4d
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime
test/hotspot/jtreg/serviceability/sa
@ -128,6 +128,9 @@ public class CompiledVFrame extends JavaVFrame {
|
|||||||
|
|
||||||
/** Returns List<MonitorInfo> */
|
/** Returns List<MonitorInfo> */
|
||||||
public List<MonitorInfo> getMonitors() {
|
public List<MonitorInfo> getMonitors() {
|
||||||
|
if (getScope() == null) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
List monitors = getScope().getMonitors();
|
List monitors = getScope().getMonitors();
|
||||||
if (monitors == null) {
|
if (monitors == null) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
|
@ -38,14 +38,17 @@ import jdk.test.lib.Platform;
|
|||||||
|
|
||||||
public class ClhsdbJstack {
|
public class ClhsdbJstack {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
private static void testJstack(boolean withXcomp) throws Exception {
|
||||||
System.out.println("Starting ClhsdbJstack test");
|
|
||||||
|
|
||||||
LingeredApp theApp = null;
|
LingeredApp theApp = null;
|
||||||
try {
|
try {
|
||||||
ClhsdbLauncher test = new ClhsdbLauncher();
|
ClhsdbLauncher test = new ClhsdbLauncher();
|
||||||
theApp = LingeredApp.startApp();
|
theApp = withXcomp ? LingeredApp.startApp(List.of("-Xcomp"))
|
||||||
System.out.println("Started LingeredApp with pid " + theApp.getPid());
|
: LingeredApp.startApp();
|
||||||
|
System.out.print("Started LingeredApp ");
|
||||||
|
if (withXcomp) {
|
||||||
|
System.out.print("(-Xcomp) ");
|
||||||
|
}
|
||||||
|
System.out.println("with pid " + theApp.getPid());
|
||||||
|
|
||||||
List<String> cmds = List.of("jstack -v");
|
List<String> cmds = List.of("jstack -v");
|
||||||
|
|
||||||
@ -61,10 +64,16 @@ public class ClhsdbJstack {
|
|||||||
|
|
||||||
test.run(theApp.getPid(), cmds, expStrMap, null);
|
test.run(theApp.getPid(), cmds, expStrMap, null);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new RuntimeException("Test ERROR " + ex, ex);
|
throw new RuntimeException("Test ERROR (with -Xcomp=" + withXcomp + ") " + ex, ex);
|
||||||
} finally {
|
} finally {
|
||||||
LingeredApp.stopApp(theApp);
|
LingeredApp.stopApp(theApp);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
System.out.println("Starting ClhsdbJstack test");
|
||||||
|
testJstack(false);
|
||||||
|
testJstack(true);
|
||||||
System.out.println("Test PASSED");
|
System.out.println("Test PASSED");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user