8343529: serviceability/sa/ClhsdbWhere.java fails AssertionFailure: Corrupted constant pool

8307318: Test serviceability/sa/ClhsdbCDSJstackPrintAll.java failed: ArrayIndexOutOfBoundsException

Reviewed-by: kevinw, amenkov
This commit is contained in:
Chris Plummer 2024-11-22 17:26:37 +00:00
parent 13987b4244
commit 21e0fb8648
3 changed files with 25 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, 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
@ -51,6 +51,10 @@ public class ClhsdbCDSJstackPrintAll {
CDSTestUtils.createArchiveAndCheck(opts);
ClhsdbLauncher test = new ClhsdbLauncher();
// This test could possibly cause some unexpected SA exceptions because one
// or more threads are active during the stack trace. Ignore them. The threads
// we care about should still be present in the output.
test.ignoreExceptions();
theApp = LingeredApp.startApp(
"-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=" + sharedArchiveName,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, 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
@ -41,9 +41,15 @@ import jdk.test.lib.SA.SATestUtils;
public class ClhsdbLauncher {
private Process toolProcess;
private boolean ignoreExceptions;
public ClhsdbLauncher() {
toolProcess = null;
ignoreExceptions = false;
}
public void ignoreExceptions() {
ignoreExceptions = true;
}
/**
@ -147,12 +153,14 @@ public class ClhsdbLauncher {
// -Xcheck:jni might be set via TEST_VM_OPTS. Make sure there are no warnings.
oa.shouldNotMatch("^WARNING: JNI local refs:.*$");
oa.shouldNotMatch("^WARNING in native method:.*$");
// This will detect most SA failures, including during the attach.
oa.shouldNotMatch("^sun.jvm.hotspot.debugger.DebuggerException:.*$");
oa.shouldNotMatch("sun.jvm.hotspot.utilities.AssertionFailure");
// This will detect unexpected exceptions, like NPEs and asserts, that are caught
// by sun.jvm.hotspot.CommandProcessor.
oa.shouldNotMatch("^Error: .*$");
if (!ignoreExceptions) {
// This will detect most SA failures, including during the attach.
oa.shouldNotMatch("^sun.jvm.hotspot.debugger.DebuggerException:.*$");
oa.shouldNotMatch("sun.jvm.hotspot.utilities.AssertionFailure");
// This will detect unexpected exceptions, like NPEs and asserts, that are caught
// by sun.jvm.hotspot.CommandProcessor.
oa.shouldNotMatch("^Error: .*$");
}
String[] parts = output.split("hsdb>");
for (String cmd : commands) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2024, 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
@ -45,6 +45,10 @@ public class ClhsdbWhere {
LingeredApp theApp = null;
try {
ClhsdbLauncher test = new ClhsdbLauncher();
// This test could possibly cause some unexpected SA exceptions because one
// or more threads are active during the stack trace. Ignore them. The threads
// we care about should still be present in the output.
test.ignoreExceptions();
theApp = LingeredApp.startApp();
System.out.println("Started LingeredApp with pid " + theApp.getPid());