Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8241004: NMT tests fail on unaligned thread size with debug build
Reviewed-by: zgu, dsamersoff
  • Loading branch information
Boris Ulasevich committed Jun 1, 2020
1 parent d0c6eef commit 0b20eafb30cc1de372141f2a427d13fdc6565e3a
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/hotspot/share/services/virtualMemoryTracker.cpp
@@ -539,15 +539,21 @@ class SnapshotThreadStackWalker : public VirtualMemoryWalker {
address committed_start;
size_t committed_size;
size_t stack_size = rgn->base() + rgn->size() - stack_bottom;
// Align the size to work with full pages (Alpine and AIX stack top is not page aligned)
size_t aligned_stack_size = align_up(stack_size, os::vm_page_size());

ReservedMemoryRegion* region = const_cast<ReservedMemoryRegion*>(rgn);
NativeCallStack ncs; // empty stack

RegionIterator itr(stack_bottom, stack_size);
RegionIterator itr(stack_bottom, aligned_stack_size);
DEBUG_ONLY(bool found_stack = false;)
while (itr.next_committed(committed_start, committed_size)) {
assert(committed_start != NULL, "Should not be null");
assert(committed_size > 0, "Should not be 0");
// unaligned stack_size case: correct the region to fit the actual stack_size
if (stack_bottom + stack_size < committed_start + committed_size) {
committed_size = stack_bottom + stack_size - committed_start;
}
region->add_committed_region(committed_start, committed_size, ncs);
DEBUG_ONLY(found_stack = true;)
}

0 comments on commit 0b20eaf

Please sign in to comment.