-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Fix exception propagation over HW exception frame on macOS arm64 #63482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix exception propagation over HW exception frame on macOS arm64 #63482
Conversation
There is a bug in setting up the fake stack frame for the PAL_DispatchExceptionWrapper. The FP and SP were not saved to the stack frame and the FP of the context was not set to match the fake prologue. That caused failure to unwind over the PAL_DispatchExceptionWrapper, reaching an unrelated native function. This change fixes it.
I can see that two of the coreclr tests fail in the ci for this PR on osx arm64. I am investigating if that's related to this change. |
The fix is actually wrong. We were already storing the fp / lr on the stack a bit above the place I've added. The only thing was that instead of LR, we were putting there PC. Which was actually correct for everything except leaf functions (the issue #62058 has the exception in a leaf function, the VSD stub). Well, even for non-leaf functions, there would be a problem if the LR was used as a general purpose register between calls. |
Unifies the hardware exception frame unwinding with Linux, it is necessary on arm64 to get correct and distinct LR and PC in the frame of the hardware exception.
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1669998117 |
@janvorli (you probably verified this already but) it does seem this broke the test, Should we open a bug? WorkItems
| where Started > now(-100d)
| where FriendlyName == "System.Composition.Hosting.Tests"
| where ExitCode != 0
| where Status == "Timeout"
| join kind= inner (
Jobs | where Started > now(-30d) | project QueueName , JobId, Build, Type, Source
) on JobId
| summarize count() by ExitCode, QueueName, format_datetime(bin(Started, 1d), 'MM-dd')
| order by Started desc
|
@danmoseley I think there is already an issue: #63561 |
…m64 (dotnet#63482)" This reverts commit 897694f.
This is affecting too many PRs. We need to revert it: #63576 |
There is a bug in setting up the fake stack frame for
the PAL_DispatchExceptionWrapper. The FP and SP were not saved
to the stack frame and the FP of the context was not set to
match the fake prologue. That caused failure to unwind over the
PAL_DispatchExceptionWrapper, reaching an unrelated native
function.
This change fixes it.
Close #62058