Admin message

Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template

Missing nonmoving write barriers in selector optimisation
The moving GC's selector optimisation implementation is currently missing a few subtle update remembered set write barriers: * https://gitlab.haskell.org/ghc/ghc/-/blob/929161943f19e1673288adc83d165ddc99865798/rts/sm/Evac.c#L1255: when we encounter a closure in the nonmoving generation (or living in moving to-space) we abort the optimisation. However, also we do not `evacuate` the closure (which is understandable given this code path originally just handled the to-space case, in which case the closure has been by definition already evacuated). This means that we failed to mark such terminal closures during the preparatory GC. * https://gitlab.haskell.org/ghc/ghc/-/blob/929161943f19e1673288adc83d165ddc99865798/rts/sm/Evac.c#L1426: If we encounter a constructor we must take care to mark the result if it is in the non-moving heap, even if the `evac` flag is not set (as it will be when `evac_thunk_selector` recurses) * https://gitlab.haskell.org/ghc/ghc/-/blob/929161943f19e1673288adc83d165ddc99865798/rts/sm/Evac.c#L1516: When we `bail_out` of the traversal loop, we call `copy` rather than evacuate on the final result. Consequently, we fail to mark the final result. Likewise, the non-moving GC's implementation of the selector optimisation may break the snapshot invariant: * https://gitlab.haskell.org/ghc/ghc/-/blob/929161943f19e1673288adc83d165ddc99865798/rts/sm/NonMovingMark.c#L659: when we encounter a `THUNK_SELECTOR` in `updateRemembSetPushThunkEager` we must treat it like any other thunk and eagerly push its free variables (namely, the selectee) * https://gitlab.haskell.org/ghc/ghc/-/blob/929161943f19e1673288adc83d165ddc99865798/rts/sm/NonMovingMark.c#L1584: When we perform the selector optimisation we must mark the selectee to preserve the snapshot invariant
issue