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
|
// snapshot current stack usage
|
||||||
VirtualMemoryTracker::Instance::snapshot_thread_stacks();
|
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_TRUE(rmr_found.is_valid());
|
||||||
ASSERT_EQ(rmr_found.base(), stack_end);
|
ASSERT_EQ(rmr_found.base(), stack_end);
|
||||||
|
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
address i_addr = (address)&i;
|
address i_addr = (address)&i;
|
||||||
bool found_i_addr = false;
|
bool found_i_addr = false;
|
||||||
|
@ -54,18 +60,20 @@ public:
|
||||||
// stack grows downward
|
// stack grows downward
|
||||||
address stack_top = stack_end + stack_size;
|
address stack_top = stack_end + stack_size;
|
||||||
bool found_stack_top = false;
|
bool found_stack_top = false;
|
||||||
VirtualMemoryTracker::Instance::tree()->visit_committed_regions(rmr_found, [&](const CommittedMemoryRegion& cmr) {
|
{
|
||||||
if (cmr.base() + cmr.size() == stack_top) {
|
MemTracker::NmtVirtualMemoryLocker vml;
|
||||||
EXPECT_TRUE(cmr.size() <= stack_size);
|
VirtualMemoryTracker::Instance::tree()->visit_committed_regions(rmr_found, [&](const CommittedMemoryRegion& cmr) {
|
||||||
found_stack_top = true;
|
if (cmr.base() + cmr.size() == stack_top) {
|
||||||
}
|
EXPECT_TRUE(cmr.size() <= stack_size);
|
||||||
if(i_addr < stack_top && i_addr >= cmr.base()) {
|
found_stack_top = true;
|
||||||
found_i_addr = true;
|
}
|
||||||
}
|
if (i_addr < stack_top && i_addr >= cmr.base()) {
|
||||||
i++;
|
found_i_addr = true;
|
||||||
return true;
|
}
|
||||||
});
|
i++;
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// stack and guard pages may be contiguous as one region
|
// stack and guard pages may be contiguous as one region
|
||||||
ASSERT_TRUE(i >= 1);
|
ASSERT_TRUE(i >= 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue