summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-07-19 01:35:40 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-19 10:08:28 -0400
commite2f0094c315746ff15b8d9650cf318f81d8416d7 (patch)
treed162dead5796b4fa75f9c8acdd92e19700aebfe0
parente8c07aa91f0f05816b455457e3781c247b7399ca (diff)
downloadhaskell-e2f0094c315746ff15b8d9650cf318f81d8416d7.tar.gz
rts/ProfHeap: Ensure new Censuses are zeroed
When growing the Census array ProfHeap previously neglected to zero the new part of the array. Consequently `freeEra` would attempt to free random words that often looked suspiciously like pointers. Fixes #21880.
-rw-r--r--rts/ProfHeap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 0e3848d616..d9e66d76d1 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -377,6 +377,7 @@ nextEra( void )
n_censuses *= 2;
censuses = stgReallocBytes(censuses, sizeof(Census) * n_censuses,
"nextEra");
+ memset(&censuses[era], 0, sizeof(Census) * n_censuses / 2);
}
}
#endif /* PROFILING */