Skip to content

Commit

Permalink
8276125: RunThese24H.java SIGSEGV in JfrThreadGroup::thread_group_id
Browse files Browse the repository at this point in the history
Backport-of: a885aab696777c99c8c4c5d9a46afc5fe0a4fe47
  • Loading branch information
Liang Mao authored and shipilev committed Jan 30, 2024
1 parent 43049fd commit 2500dbe
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,12 @@ int JfrThreadGroupsHelper::populate_thread_group_hierarchy(const JavaThread* jt,
assert(current != NULL, "invariant");
assert(_thread_group_hierarchy != NULL, "invariant");

oop thread_oop = jt->threadObj();
if (thread_oop == nullptr) {
return 0;
}
// immediate thread group
Handle thread_group_handle(current, java_lang_Thread::threadGroup(jt->threadObj()));
Handle thread_group_handle(current, java_lang_Thread::threadGroup(thread_oop));
if (thread_group_handle == NULL) {
return 0;
}
Expand All @@ -167,7 +171,7 @@ int JfrThreadGroupsHelper::populate_thread_group_hierarchy(const JavaThread* jt,
Handle parent_thread_group_handle(current, parent_thread_group_obj);

// and check parents parents...
while (!(parent_thread_group_handle == NULL)) {
while (parent_thread_group_handle != nullptr) {
const jweak parent_group_weak_ref = use_weak_handles ? JNIHandles::make_weak_global(parent_thread_group_handle) : NULL;
thread_group_pointers = new JfrThreadGroupPointers(parent_thread_group_handle, parent_group_weak_ref);
_thread_group_hierarchy->append(thread_group_pointers);
Expand Down

1 comment on commit 2500dbe

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.