You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a race condition between activation signal handling and returning
from a hardware exception handler on macOS. It shows up intermittently in
the Regression/coreclr/GitHub_16833 test in the CI and I am able to repro
it on my local mac once in several thousands of iterations of the test when
running with GC stress C.
It turned out the issue is caused by the order in which we set parts of the
context in the thread when returning from the hardware exception handler.
MacOS can only set the floating point and control / integer portions separately.
We were setting the control / integer portion first and the floating point
portion after that. In the race condition, the signal handling code in the
macOS extracts the context that contains the new control registers, but the
old floating point ones (which is the state of those in the PAL_DispatchException).
The signal handler for the activation injection then gets executed and when it
returns later to our managed code, the floating point registers get restored
to the wrong values.
The fix is to change the context setting to first set the floating point
registers and then the control / integer portion of the context.
Close#66568
Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
0 commit comments