8306428: RunThese30M.java crashed with assert(early->flag() == current->flag() || early->flag() == mtNone)

Reviewed-by: jsjolen, stuefe
This commit is contained in:
Gerard Ziemski 2023-05-27 18:28:49 +00:00
parent 5fdb22f911
commit ca54f4e007

View File

@ -780,6 +780,13 @@ void MemDetailDiffReporter::diff_virtual_memory_sites() const {
} else if (compVal > 0) {
old_virtual_memory_site(early_site);
early_site = early_itr.next();
} else if (early_site->flag() != current_site->flag()) {
// This site was originally allocated with one flag, then released,
// then re-allocated at the same site (as far as we can tell) with a different flag.
old_virtual_memory_site(early_site);
early_site = early_itr.next();
new_virtual_memory_site(current_site);
current_site = current_itr.next();
} else {
diff_virtual_memory_site(early_site, current_site);
early_site = early_itr.next();
@ -842,8 +849,6 @@ void MemDetailDiffReporter::old_virtual_memory_site(const VirtualMemoryAllocatio
void MemDetailDiffReporter::diff_virtual_memory_site(const VirtualMemoryAllocationSite* early,
const VirtualMemoryAllocationSite* current) const {
assert(early->flag() == current->flag() || early->flag() == mtNone,
"Expect the same flag, but %s != %s", NMTUtil::flag_to_name(early->flag()),NMTUtil::flag_to_name(current->flag()));
diff_virtual_memory_site(current->call_stack(), current->reserved(), current->committed(),
early->reserved(), early->committed(), current->flag());
}