summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-07-19 01:35:40 -0400
committerDouglas Wilson <douglas.wilson@gmail.com>2022-07-27 11:38:09 +0100
commit9187b984d602dc38050801f11ec31dc56085f029 (patch)
treeea17dd68f2e87051d5534c43ee67849371fad8c2
parented9c4c6af55d6599eea8c6a0579a3b4bff05b303 (diff)
downloadhaskell-9187b984d602dc38050801f11ec31dc56085f029.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. (cherry picked from commit e2f0094c315746ff15b8d9650cf318f81d8416d7)
-rw-r--r--rts/ProfHeap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index ab65feab2b..c24e1e70ca 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 */