As described in the steps to reproduce, it would appear that switching back and forth between multiple linked anim layers that use the same ControlRig, by unlinking the active one and then linking the other (repeatedly) can can a RigVM crash where it attempts to access an invalid TArray entry (executing on a worker thread as part of the animgraph evaluation). The FirstHandleForInstruction URigVM is reset/reconstructed when the animation layers that reference the control rig is linked, modifying the shared RigVM:
Steps to Reproduce
Have two linked animation layers reference and use the same control rig. On the game thread switch back and forth between them, unlinking the active linked animation layer, then linking the other. Repro can be unreliable as this seems to be a threading issue. Eventually you will hit an index out of bound check in the TArray caused by:
Thanks for raising this, we recently made a fix for some other crashes around some of the same issues as this. This change might address your issue, but let us know if it doesn’t.