This 19895 replay reproduces the infinite loop and subsequent segfault:
{F177549}
(or adapt the patch to a21 and test on the commands.txt uploaded on #4523 a few days ago.)
A way to reliably reproduce the bug ingame is to assign a control-group to a unit, garrison it, then keep the controlgroup hotkey pressed (to select the unit for some frames) and keep right clicking a resource.