Skip to content

Commit 0dc9e84

Browse files
author
David Holmes
committed
8358645: Access violation in ThreadsSMRSupport::print_info_on during thread dump
Reviewed-by: shade, dcubed Backport-of: 334683e
1 parent 12ffb0c commit 0dc9e84

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/hotspot/share/runtime/threadSMR.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,9 +1168,10 @@ void ThreadsSMRSupport::print_info_on(const Thread* thread, outputStream* st) {
11681168
// The count is only interesting if we have a _threads_list_ptr.
11691169
st->print(", _nested_threads_hazard_ptr_cnt=%u", thread->_nested_threads_hazard_ptr_cnt);
11701170
}
1171-
if (SafepointSynchronize::is_at_safepoint() || Thread::current() == thread) {
1172-
// It is only safe to walk the list if we're at a safepoint or the
1173-
// calling thread is walking its own list.
1171+
if ((SafepointSynchronize::is_at_safepoint() && thread->is_Java_thread()) ||
1172+
Thread::current() == thread) {
1173+
// It is only safe to walk the list if we're at a safepoint and processing a JavaThread,
1174+
// or the calling thread is walking its own list.
11741175
SafeThreadsListPtr* current = thread->_threads_list_ptr;
11751176
if (current != nullptr) {
11761177
// Skip the top nesting level as it is always printed above.

0 commit comments

Comments
 (0)