Skip to content

Commit 2500dbe

Browse files
Liang Maoshipilev
Liang Mao
authored andcommittedJan 30, 2024
8276125: RunThese24H.java SIGSEGV in JfrThreadGroup::thread_group_id
Backport-of: a885aab696777c99c8c4c5d9a46afc5fe0a4fe47
1 parent 43049fd commit 2500dbe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,12 @@ int JfrThreadGroupsHelper::populate_thread_group_hierarchy(const JavaThread* jt,
151151
assert(current != NULL, "invariant");
152152
assert(_thread_group_hierarchy != NULL, "invariant");
153153

154+
oop thread_oop = jt->threadObj();
155+
if (thread_oop == nullptr) {
156+
return 0;
157+
}
154158
// immediate thread group
155-
Handle thread_group_handle(current, java_lang_Thread::threadGroup(jt->threadObj()));
159+
Handle thread_group_handle(current, java_lang_Thread::threadGroup(thread_oop));
156160
if (thread_group_handle == NULL) {
157161
return 0;
158162
}
@@ -167,7 +171,7 @@ int JfrThreadGroupsHelper::populate_thread_group_hierarchy(const JavaThread* jt,
167171
Handle parent_thread_group_handle(current, parent_thread_group_obj);
168172

169173
// and check parents parents...
170-
while (!(parent_thread_group_handle == NULL)) {
174+
while (parent_thread_group_handle != nullptr) {
171175
const jweak parent_group_weak_ref = use_weak_handles ? JNIHandles::make_weak_global(parent_thread_group_handle) : NULL;
172176
thread_group_pointers = new JfrThreadGroupPointers(parent_thread_group_handle, parent_group_weak_ref);
173177
_thread_group_hierarchy->append(thread_group_pointers);

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jan 30, 2024

@openjdk-notifier[bot]
Please sign in to comment.