From 21e0fb8648d61f041a04d44ad6c46fc5efd86261 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Fri, 22 Nov 2024 17:26:37 +0000 Subject: [PATCH] 8343529: serviceability/sa/ClhsdbWhere.java fails AssertionFailure: Corrupted constant pool 8307318: Test serviceability/sa/ClhsdbCDSJstackPrintAll.java failed: ArrayIndexOutOfBoundsException Reviewed-by: kevinw, amenkov --- .../sa/ClhsdbCDSJstackPrintAll.java | 6 ++++- .../serviceability/sa/ClhsdbLauncher.java | 22 +++++++++++++------ .../jtreg/serviceability/sa/ClhsdbWhere.java | 6 ++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java index 3fe60de2364..4d01f9a26c8 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java @@ -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, diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java index 849ec2eb109..8ac67c366cd 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java @@ -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) { diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java index f3dab6dd976..547034463d7 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java @@ -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());