From 40dbc47814533cbe0f9db99e4a848e503b87f476 Mon Sep 17 00:00:00 2001 Subject: 8269934: RunThese24H.java failed with EXCEPTION_ACCESS_VIOLATION in java_lang_Thread::get_thread_status --- hotspot/src/share/vm/services/threadService.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/services/threadService.cpp b/hotspot/src/share/vm/services/threadService.cpp index 3bfd6b538..b290ad548 100644 --- a/hotspot/src/share/vm/services/threadService.cpp +++ b/hotspot/src/share/vm/services/threadService.cpp @@ -791,7 +791,9 @@ ThreadSnapshot::ThreadSnapshot(JavaThread* thread) { _blocker_object = NULL; _blocker_object_owner = NULL; - _thread_status = java_lang_Thread::get_thread_status(_threadObj); + // If thread is still attaching then threadObj will be NULL. + _thread_status = _threadObj == NULL ? java_lang_Thread::NEW + : java_lang_Thread::get_thread_status(_threadObj); _is_ext_suspended = thread->is_being_ext_suspended(); _is_in_native = (thread->thread_state() == _thread_in_native); -- 2.22.0