BZ #85: possbile race with trap instructions and signal handlers
Since we are using trap instructions to invoke patcher functions, we can hit a race
condition here in the following situation:
2 threads are running on 2 CPUs. The first thread hits the trap and executes the
patcher function. The second thread hits the trap instruction and right after the trap
for the second thread is handled by the kernel, the first thread patches back the
original instruction. The second thread sees then the original instruction in the
signal handler instead of the trap instruction and most likely aborts, since it can't
read the required data from the trap instruction.
A solution would be to check in the signal handler if there is a trap instruction at the
faulting position (PC) and if not, check the patcher list if there was a patcher trap at
this PC which has already been patched. If that is true, simply return.
|desc:||make fp-abi hack compatible with neon hardware