From 85c622b5978ff1209130aff0634aa770de5d86ef Mon Sep 17 00:00:00 2001 From: fernandosalas Date: Fri, 30 Jun 2023 20:55:40 +0000 Subject: [PATCH] [scudo] Improve Secondary Cache Dump Exclude cached blocks with invalid start address. Mainly concerned with cached blocks that are still available/unused. Reviewed By: Chia-hungDuan, cferris Differential Revision: https://reviews.llvm.org/D154148 --- compiler-rt/lib/scudo/standalone/secondary.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h index 5217b71..105b154 100644 --- a/compiler-rt/lib/scudo/standalone/secondary.h +++ b/compiler-rt/lib/scudo/standalone/secondary.h @@ -143,9 +143,11 @@ public: EntriesCount, atomic_load_relaxed(&MaxEntriesCount), atomic_load_relaxed(&MaxEntrySize)); for (CachedBlock Entry : Entries) { + if (!Entry.CommitBase) + continue; Str->append("StartBlockAddress: 0x%zx, EndBlockAddress: 0x%zx, " "BlockSize: %zu\n", - Entry.CommitBase, (Entry.CommitBase + Entry.CommitSize), + Entry.CommitBase, Entry.CommitBase + Entry.CommitSize, Entry.CommitSize); } } -- 2.7.4