summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-07-19 01:35:40 -0400
committerZubin Duggal <zubin.duggal@gmail.com>2022-07-27 01:58:03 +0530
commit65d61702974704205de50d2be0444e30eee00348 (patch)
tree1e21b44c40f457e6ff86bd2a86deb5195bda649d
parent786ba79578de5518ae3788a2241de6a2b73a9280 (diff)
downloadhaskell-65d61702974704205de50d2be0444e30eee00348.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 4f0fd4c7b1..863afbd0e1 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -366,6 +366,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 */