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()) {