diff options
Diffstat (limited to 'rts/sm/Storage.c')
-rw-r--r-- | rts/sm/Storage.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index 7d450a8931..b29c734f81 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -828,6 +828,14 @@ resetNurseries (void) ASSERT(bd->gen == g0); ASSERT(bd->node == capNoToNumaNode(n)); IF_DEBUG(zero_on_gc, memset(bd->start, 0xaa, BLOCK_SIZE)); + + // In the non-DEBUG RTS we initialize bd->free lazily (e.g. when + // the mutator starts allocating into the block in stg_gc_noregs). + // However, in the past we have had bugs (e.g. #16862) where code + // looked at the ->free field of blocks that the mutator never + // allocated into. We set the free pointer to a dummy value + // (0xaaaaa...) to catch this. + IF_DEBUG(sanity, memset(&bd->free, 0xaa, sizeof(bd->free))); } } #endif |