From 64caf085344dcd5fc5185ed5882439249e239d50 Mon Sep 17 00:00:00 2001 From: Axel Boldt-Christmas Date: Mon, 10 Mar 2025 11:53:50 +0000 Subject: [PATCH] 8350572: ZGC: Enhance z_verify_safepoints_are_blocked interactions with VMError Reviewed-by: eosterlund, stefank --- src/hotspot/share/gc/z/zVerify.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hotspot/share/gc/z/zVerify.cpp b/src/hotspot/share/gc/z/zVerify.cpp index 8e2022d781a..439a3710185 100644 --- a/src/hotspot/share/gc/z/zVerify.cpp +++ b/src/hotspot/share/gc/z/zVerify.cpp @@ -53,6 +53,7 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/preserveException.hpp" #include "utilities/resourceHash.hpp" +#include "utilities/vmError.hpp" #ifdef ASSERT @@ -60,6 +61,13 @@ // with callers to this function. Typically used to verify that object oops // and headers are safe to access. void z_verify_safepoints_are_blocked() { + if (VMError::is_error_reported_in_current_thread()) { + // The current thread has crashed and is creating an error report. + // This may occur from any thread state, skip the safepoint_are_blocked + // verification. + return; + } + Thread* current = Thread::current(); if (current->is_ConcurrentGC_thread()) {