Failure to encode rseq region that writes SP on aarch64
An app with an rseq region that writes SP crashes in release build and in debug it hits:
<Attached to 516 threads in application xxx (1000286)>
<Internal Error: Failed to encode instruction: 'str %sp -> +0x0660(%x0)[8byte]'
>
<dropping 3rd pending alarm signal>
<Application xxx (1000286). Internal Error: DynamoRIO debug check failure: core/emit.c:363 pc != NULL
The culprit is the rseq mangling register snapshot code which treats SP like a GPR and tries to store and load from and to it.