mmtk-core
mmtk-core copied to clipboard
Stale forwarding bits in nursery GC in StickyImmix
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.
Pin bit is not cleared as well. We should approach this issue systematically.
https://github.com/mmtk/mmtk-core/pull/1128 stated that it did not fix this. Github probably captured 'fix it' and closed this issue.
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.
Fixed in https://github.com/mmtk/mmtk-core/pull/1138