Closed k15tfu closed 2 years ago
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 CallEHFunclet
instead of the CallDescrWorkerInternal
.
Fixed by #62719
@janvorli @jakobbotsch @jkotas Hi! Unfortunately my repro still doesn't work with that fix #62719, but the repro from https://github.com/dotnet/runtime/issues/61486#issuecomment-966825047 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
I see that it is fixed by https://github.com/dotnet/runtime/pull/63596 and backported to 6.0 in https://github.com/dotnet/runtime/pull/64262, thanks.
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 https://github.com/dotnet/runtime/issues/51250#issuecomment-888293088 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: https://github.com/dotnet/runtime/issues/51250, https://github.com/dotnet/runtime/issues/49070.