mmtk-core icon indicating copy to clipboard operation
mmtk-core copied to clipboard

Stale forwarding bits in nursery GC in StickyImmix

Open wks opened this issue 10 months ago • 2 comments

Currently in StickyImmix, we clear both on-the-side mark bits and on-the-side forwarding bits (the Ruby binding currently uses on-the-side forwarding bits) in the Prepare stage of major GC, and we clear neither of them in nursery GC. For Immix and non-moving StickyImmix, this works fine because (1) every GC is a major GC for Immix, and (2) we never forward anything if StickyImmix never moves object.

However, if we use StickyImmix and enable object movement, the forwarding bits set in a full-heap GC will remain set until the next full-heap GC. Some of them are set for from-space objects that have already been moved. If a nursery GC happens in between, and there is an object happened to be allocated at the place where a stale forwarding bits is set, the nursery GC will erroneously consider the object as moved. When this error manifests, weak reference processors will see a non-moved object have a forwarding pointer, and its value is whatever currently stored in the object at the offset for storing forwarding reference.

wks avatar Apr 16 '24 12:04 wks

Pin bit is not cleared as well. We should approach this issue systematically.

qinsoon avatar Apr 17 '24 06:04 qinsoon

https://github.com/mmtk/mmtk-core/pull/1128 stated that it did not fix this. Github probably captured 'fix it' and closed this issue.

qinsoon avatar May 16 '24 09:05 qinsoon

https://github.com/mmtk/mmtk-core/pull/1169 and the discussion in https://mmtk.zulipchat.com/#narrow/stream/262673-mmtk-core/topic/Nursery.20GC.20recycling.20old.20objects is another example of stale side log bits.

qinsoon avatar Jul 18 '24 00:07 qinsoon

Fixed in https://github.com/mmtk/mmtk-core/pull/1138

wks avatar Jul 19 '24 04:07 wks