I was able to reproduce this error in SVN. You can reliably cause the segfault by:
- Select a citizen cavalry unit
- Click to hunt an animal (camel, in this case), but don't actually kill it.
- Garrison the cavalry
- Use the script console to post a network message telling the garrisoned cavalry to resume work: Engine.PostNetworkCommand({"type":"back-to-work","entities":[21062]}).
- It segfaults
The error can also be triggered without using the script console.
- Select a citizen cavalry unit
- Click to hunt an animal (camel, in this case), but don't actually kill it.
- Click to stand right next to the building you will garrison into
- Set the game speed to Turtle (0.1x) to make the next step easier
- Ctrl-click to garrison into the building, and very quickly afterwards press y to resume work, so that both commands post to the same turn.
- the game segfaults. It may take a few tries before this happens.
I have provided a replay of this in SVN.
However, note that this method is not quite the same thing nigel87 did. He garrisoned his cavalry (entity 21062) many turns before he ordered it to resume work. How did he issue the command for it to resume work, without the script console and without issuing very fast consecutive commands?