Skip to content

Commit

Permalink
8340401: test for thread with uninitialized stack
Browse files Browse the repository at this point in the history
  • Loading branch information
stooke committed Sep 20, 2024
1 parent 5c04020 commit 9b54225
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hotspot/share/nmt/memMapPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ static bool vma_touches_thread_stack(const void* from, const void* to, const Thr
// Very rarely however is a VMA backing a thread stack folded together with another adjacent VMA by the
// kernel. That can happen, e.g., for non-java threads that don't have guard pages.
// Therefore we go for the simplest way here and check for intersection between VMA and thread stack.
// If the stack size is zero (i.e. no stack assigned yet), then return false.
if (t->stack_size() == 0) return false;
return range_intersects(from, to, (const void*)t->stack_end(), (const void*)t->stack_base());
}

Expand Down Expand Up @@ -211,7 +209,7 @@ static void print_thread_details_for_supposed_stack_address(const void* from, co
ResourceMark rm;

#define HANDLE_THREAD(T) \
if (T != nullptr && vma_touches_thread_stack(from, to, T)) { \
if (T != nullptr && T->stack_size() != 0 && vma_touches_thread_stack(from, to, T)) { \
print_thread_details((uintx)(T->osthread()->thread_id()), T->name(), st); \
return; \
}
Expand Down

0 comments on commit 9b54225

Please sign in to comment.