diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-07-19 01:35:40 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-19 10:08:28 -0400 |
commit | e2f0094c315746ff15b8d9650cf318f81d8416d7 (patch) | |
tree | d162dead5796b4fa75f9c8acdd92e19700aebfe0 | |
parent | e8c07aa91f0f05816b455457e3781c247b7399ca (diff) | |
download | haskell-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.c | 1 |
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 */ |