Skip to content

Commit 7e943e7

Browse files
author
David Holmes
committed
8380474: Crash SEGV in ThreadIdTable::lazy_initialize after JDK-8323792
Reviewed-by: kvn, iklam
1 parent b79449f commit 7e943e7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/hotspot/share/services/threadIdTable.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424

2525
#include "classfile/javaClasses.inline.hpp"
26+
#include "runtime/handles.hpp"
2627
#include "runtime/interfaceSupport.inline.hpp"
2728
#include "runtime/javaThread.inline.hpp"
2829
#include "runtime/threadSMR.hpp"
@@ -94,11 +95,11 @@ void ThreadIdTable::lazy_initialize(const ThreadsList *threads) {
9495

9596
for (uint i = 0; i < threads->length(); i++) {
9697
JavaThread* thread = threads->thread_at(i);
97-
oop tobj = thread->threadObj();
98+
Handle tobj = Handle(JavaThread::current(), thread->threadObj());
9899
if (tobj != nullptr) {
99100
MutexLocker ml(Threads_lock);
100101
if (!thread->is_exiting()) {
101-
jlong java_tid = java_lang_Thread::thread_id(tobj);
102+
jlong java_tid = java_lang_Thread::thread_id(tobj());
102103
// Must be inside the lock to ensure that we don't add a thread to the table
103104
// that has just passed the removal point in Threads::remove().
104105
add_thread(java_tid, thread);

0 commit comments

Comments
 (0)