summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-07-19 01:35:40 -0400
committerBen Gamari <ben@smart-cactus.org>2022-07-19 01:35:40 -0400
commit6f2788424761ce4fd9287ee8bf805d866a8d3cb4 (patch)
tree31b99391124e5d7953ff496c57c3ffff3b0e0a9c
parentaf6731a40782b418947d376a09fd605111dfea2a (diff)
downloadhaskell-wip/T21880.tar.gz
rts/ProfHeap: Ensure new Censuses are zeroedwip/T21880
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 */