mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-15 13:49:42 +02:00
8364280: NMTCommittedVirtualMemoryTracker.test_committed_virtualmemory_region_vm fails with assertion "negative distance"
Reviewed-by: gziemski, jsjolen
This commit is contained in:
parent
d78fa5a9f6
commit
db12f1934a
1 changed files with 21 additions and 13 deletions
|
@ -43,10 +43,16 @@ public:
|
|||
// snapshot current stack usage
|
||||
VirtualMemoryTracker::Instance::snapshot_thread_stacks();
|
||||
|
||||
ReservedMemoryRegion rmr_found = VirtualMemoryTracker::Instance::tree()->find_reserved_region(stack_end);
|
||||
ReservedMemoryRegion rmr_found;
|
||||
{
|
||||
MemTracker::NmtVirtualMemoryLocker vml;
|
||||
rmr_found = VirtualMemoryTracker::Instance::tree()->find_reserved_region(stack_end);
|
||||
}
|
||||
|
||||
ASSERT_TRUE(rmr_found.is_valid());
|
||||
ASSERT_EQ(rmr_found.base(), stack_end);
|
||||
|
||||
|
||||
int i = 0;
|
||||
address i_addr = (address)&i;
|
||||
bool found_i_addr = false;
|
||||
|
@ -54,6 +60,8 @@ public:
|
|||
// stack grows downward
|
||||
address stack_top = stack_end + stack_size;
|
||||
bool found_stack_top = false;
|
||||
{
|
||||
MemTracker::NmtVirtualMemoryLocker vml;
|
||||
VirtualMemoryTracker::Instance::tree()->visit_committed_regions(rmr_found, [&](const CommittedMemoryRegion& cmr) {
|
||||
if (cmr.base() + cmr.size() == stack_top) {
|
||||
EXPECT_TRUE(cmr.size() <= stack_size);
|
||||
|
@ -65,7 +73,7 @@ public:
|
|||
i++;
|
||||
return true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// stack and guard pages may be contiguous as one region
|
||||
ASSERT_TRUE(i >= 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue