8269934: RunThese24H.java failed with EXCEPTION_ACCESS_VIOLATION in java_lang_Thread::get_thread_status

Reviewed-by: stuefe, dcubed, sspitsyn
This commit is contained in:
David Holmes 2021-08-04 02:08:30 +00:00
parent 659498a07f
commit 7e518f42c9

View file

@ -874,7 +874,10 @@ void ThreadSnapshot::initialize(ThreadsList * t_list, JavaThread* thread) {
_sleep_ticks = stat->sleep_ticks();
_sleep_count = stat->sleep_count();
_thread_status = java_lang_Thread::get_thread_status(threadObj);
// If thread is still attaching then threadObj will be NULL.
_thread_status = threadObj == NULL ? JavaThreadStatus::NEW
: java_lang_Thread::get_thread_status(threadObj);
_is_suspended = thread->is_suspended();
_is_in_native = (thread->thread_state() == _thread_in_native);