diff --git a/gc/verbose/VerboseHandlerOutput.cpp b/gc/verbose/VerboseHandlerOutput.cpp index b5abe129b55..43e667ef413 100644 --- a/gc/verbose/VerboseHandlerOutput.cpp +++ b/gc/verbose/VerboseHandlerOutput.cpp @@ -598,8 +598,12 @@ MM_VerboseHandlerOutput::handleExclusiveStart(J9HookInterface** hook, uintptr_t manager->setLastExclusiveAccessStartTime(currentTime); OMR_VMThread* lastResponder = event->lastResponder; - char escapedLastResponderName[64]; - getThreadName(escapedLastResponderName,sizeof(escapedLastResponderName),lastResponder); + char escapedLastResponderName[64] = ""; + + /* Last Responder thread can be passed NULL in the case of Safe Point Exclusive */ + if (NULL != lastResponder) { + getThreadName(escapedLastResponderName, sizeof(escapedLastResponderName), lastResponder); + } char tagTemplate[200]; getTagTemplate(tagTemplate, sizeof(tagTemplate), manager->getIdAndIncrement(), omrtime_current_time_millis()); @@ -608,8 +612,12 @@ MM_VerboseHandlerOutput::handleExclusiveStart(J9HookInterface** hook, uintptr_t writer->formatAndOutput(env, 0, ""); } writer->formatAndOutput(env, 0, "", tagTemplate, deltaTime / 1000, deltaTime % 1000); - writer->formatAndOutput(env, 1, "", - exclusiveAccessTime / 1000, exclusiveAccessTime % 1000, meanIdleTime / 1000, meanIdleTime % 1000, event->haltedThreads, (NULL == lastResponder ? NULL : lastResponder->_language_vmthread), escapedLastResponderName); + + writer->formatAndOutput( + env, 1, "", + exclusiveAccessTime / 1000, exclusiveAccessTime % 1000, meanIdleTime / 1000, meanIdleTime % 1000, event->haltedThreads, + (NULL == lastResponder ? NULL : lastResponder->_language_vmthread), escapedLastResponderName); + writer->formatAndOutput(env, 0, ""); writer->flush(env); exitAtomicReportingBlock();