-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
UnwindManagedExceptionPass1 crashes on virtual dispatch stub when handling System.NullReferenceException on macOS ARM64 #62058
Comments
My guts feeling is that it is yet another problem similar to #61486 caused by tail calling a VSD stub. I'll investigate it. |
@k15tfu thank you very much for the analysis and the simple repro! |
My feeling was right, I have verified that it is a variant of the #61486. The only difference is that this time the caller was |
Fixed by #62719 |
@janvorli @jakobbotsch @jkotas Hi! Unfortunately my repro still doesn't work with that fix #62719, but the repro from #61486 (comment) works fine now. Could you please reopen this issue and take another look at it? |
I don't see where the repro you posted would be doing any tailcalls so there might be another related issue here. @janvorli do you have time to check? |
@janvorli Friendly ping. |
I am sorry for the late response, I was OOF since December 15. @jakobbotsch when I was trying to repro this issue about a month ago, the symptoms looked the same as with the other issue. I'll retry the repro it again to see what's wrong. |
FWIW, I tried to repro this on Ubuntu arm64 last month but I was unable to, so it might be MacOS only unless I missed something. |
I've found the cuprit, it was completely unrelated to the issue @jakobbotsch fixed. While the exception occured in a VSD stub, the CallEHFunclet I've seen on the stack was a red herring. It occurred there due to a bug in the hardware exception handling specific to arm64 macOS. |
reactivating as fix was reverted |
Hi!
I faced with the following crash running managed .NET 6 app on Apple Silicon:
Looking into this, I found that the crash happens while handling System.NullReferenceException in the catch block, which is called via
CallEHFunclet
. Here is its stack and registers on enter:The first exception (i.e. System.NullReferenceException) happens in a virtual dispatch stub because
x0
is 0:After that, when we throw an exception from the catch block, the runtime starts unwinding the stack from the
Program.CatchRethrow()
frame and finally segfaults inUnwindManagedExceptionPass1()
, trying toEECodeInfo::GetFunctionEntry()
forCallEHFunclet
:We have seen the same crash in #51250 (comment) no. 3 because there were a lot of System.NullReferenceException exceptions.
P.S. Ultimately I was able to create a simple program that reproduces this problem:
Linked issues: #51250, #49070.
The text was updated successfully, but these errors were encountered: