Skip to content

Commit 21e0fb8

Browse files
committed
8343529: serviceability/sa/ClhsdbWhere.java fails AssertionFailure: Corrupted constant pool
8307318: Test serviceability/sa/ClhsdbCDSJstackPrintAll.java failed: ArrayIndexOutOfBoundsException Reviewed-by: kevinw, amenkov
1 parent 13987b4 commit 21e0fb8

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java

Lines changed: 5 additions & 1 deletion
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, 2024, 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
@@ -51,6 +51,10 @@ public static void main(String[] args) throws Exception {
5151
CDSTestUtils.createArchiveAndCheck(opts);
5252

5353
ClhsdbLauncher test = new ClhsdbLauncher();
54+
// This test could possibly cause some unexpected SA exceptions because one
55+
// or more threads are active during the stack trace. Ignore them. The threads
56+
// we care about should still be present in the output.
57+
test.ignoreExceptions();
5458
theApp = LingeredApp.startApp(
5559
"-XX:+UnlockDiagnosticVMOptions",
5660
"-XX:SharedArchiveFile=" + sharedArchiveName,

test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java

Lines changed: 15 additions & 7 deletions
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, 2024, 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
@@ -41,9 +41,15 @@
4141
public class ClhsdbLauncher {
4242

4343
private Process toolProcess;
44+
private boolean ignoreExceptions;
4445

4546
public ClhsdbLauncher() {
4647
toolProcess = null;
48+
ignoreExceptions = false;
49+
}
50+
51+
public void ignoreExceptions() {
52+
ignoreExceptions = true;
4753
}
4854

4955
/**
@@ -147,12 +153,14 @@ private String runCmd(List<String> commands,
147153
// -Xcheck:jni might be set via TEST_VM_OPTS. Make sure there are no warnings.
148154
oa.shouldNotMatch("^WARNING: JNI local refs:.*$");
149155
oa.shouldNotMatch("^WARNING in native method:.*$");
150-
// This will detect most SA failures, including during the attach.
151-
oa.shouldNotMatch("^sun.jvm.hotspot.debugger.DebuggerException:.*$");
152-
oa.shouldNotMatch("sun.jvm.hotspot.utilities.AssertionFailure");
153-
// This will detect unexpected exceptions, like NPEs and asserts, that are caught
154-
// by sun.jvm.hotspot.CommandProcessor.
155-
oa.shouldNotMatch("^Error: .*$");
156+
if (!ignoreExceptions) {
157+
// This will detect most SA failures, including during the attach.
158+
oa.shouldNotMatch("^sun.jvm.hotspot.debugger.DebuggerException:.*$");
159+
oa.shouldNotMatch("sun.jvm.hotspot.utilities.AssertionFailure");
160+
// This will detect unexpected exceptions, like NPEs and asserts, that are caught
161+
// by sun.jvm.hotspot.CommandProcessor.
162+
oa.shouldNotMatch("^Error: .*$");
163+
}
156164

157165
String[] parts = output.split("hsdb>");
158166
for (String cmd : commands) {

test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java

Lines changed: 5 additions & 1 deletion
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, 2024, 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
@@ -45,6 +45,10 @@ public static void main(String[] args) throws Exception {
4545
LingeredApp theApp = null;
4646
try {
4747
ClhsdbLauncher test = new ClhsdbLauncher();
48+
// This test could possibly cause some unexpected SA exceptions because one
49+
// or more threads are active during the stack trace. Ignore them. The threads
50+
// we care about should still be present in the output.
51+
test.ignoreExceptions();
4852
theApp = LingeredApp.startApp();
4953
System.out.println("Started LingeredApp with pid " + theApp.getPid());
5054

0 commit comments

Comments
 (0)