From 15d36ee4a5dc3a143faccd59ecc3f9b0b45ed5d3 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Wed, 2 Apr 2025 03:56:19 +0000 Subject: [PATCH] 8353330: Test runtime/cds/appcds/SignedJar.java fails in CDSHeapVerifier Reviewed-by: vlivanov, dholmes, liach --- src/hotspot/share/cds/cdsHeapVerifier.cpp | 13 ++++++++++++- test/hotspot/jtreg/ProblemList.txt | 2 -- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/cds/cdsHeapVerifier.cpp b/src/hotspot/share/cds/cdsHeapVerifier.cpp index 729637f47c2..9bab62dabe6 100644 --- a/src/hotspot/share/cds/cdsHeapVerifier.cpp +++ b/src/hotspot/share/cds/cdsHeapVerifier.cpp @@ -41,7 +41,11 @@ #if INCLUDE_CDS_JAVA_HEAP // CDSHeapVerifier is used to check for problems where an archived object references a -// static field that may be get a different value at runtime. In the following example, +// static field that may be get a different value at runtime. +// +// *Please see comments in aotClassInitializer.cpp for how to avoid such problems*, +// +// In the following example, // Foo.get.test() // correctly returns true when CDS disabled, but incorrectly returns false when CDS is enabled, // because the archived archivedFoo.bar value is different than Bar.bar. @@ -133,6 +137,12 @@ CDSHeapVerifier::CDSHeapVerifier() : _archived_objs(0), _problems(0) ADD_EXCL("java/lang/invoke/InvokerBytecodeGenerator", "MEMBERNAME_FACTORY", // D "CD_Object_array", // E same as <...>ConstantUtils.CD_Object_array::CD_Object "INVOKER_SUPER_DESC"); // E same as java.lang.constant.ConstantDescs::CD_Object + + ADD_EXCL("java/lang/invoke/MethodHandleImpl$ArrayAccessor", + "OBJECT_ARRAY_GETTER", // D + "OBJECT_ARRAY_SETTER", // D + "OBJECT_ARRAY_LENGTH"); // D + } # undef ADD_EXCL @@ -145,6 +155,7 @@ CDSHeapVerifier::~CDSHeapVerifier() { log_error(cds, heap)("Scanned %d objects. Found %d case(s) where " "an object points to a static field that " "may hold a different value at runtime.", _archived_objs, _problems); + log_error(cds, heap)("Please see cdsHeapVerifier.cpp and aotClassInitializer.cpp for details"); MetaspaceShared::unrecoverable_writing_error(); } } diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index dbacefa1f30..0e71df4f27f 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -103,8 +103,6 @@ gc/shenandoah/TestEvilSyncBug.java#generational 8345501 generic-all # :hotspot_runtime -runtime/cds/appcds/SignedJar.java 8353330 generic-all - runtime/jni/terminatedThread/TestTerminatedThread.java 8317789 aix-ppc64 runtime/handshake/HandshakeSuspendExitTest.java 8294313 generic-all runtime/Monitor/SyncOnValueBasedClassTest.java 8340995 linux-s390x