dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.25k stars 4.73k forks source link

terminate called after throwing an instance of 'PAL_SEHException' #107785

Open JackJiang1234 opened 1 month ago

JackJiang1234 commented 1 month ago

Hey buddy, we have an ASP.NET Core app deployed in a Kubernetes Docker environment. Lately, it’s been crashing occasionally, and the error message is as stated in the title, but there's no stack trace. We're using .NET Core version net6. Do you know any way to catch the specific error details?

colejohnson66 commented 1 month ago

Are you using Mono or CoreCLR? Does the issue still occur on .NET 8 or .NET 9?

jkotas commented 1 month ago

PAL_SEHException should be always caught by the runtime code, it should never escape unhandled. If you see it escaping unhandled, it means there is a bug in the runtime. To get more detail, you would need to get a crash dump and inspect it under native debugger (lldb).

We have fixed a few bugs that can cause PAL_SEHException to escape. I agree with @colejohnson66 that upgrading to newer version is a good idea. .NET 6 has only two months of life left, so you will need to upgrade soon anyway to stay on a supported version.

JackJiang1234 commented 1 month ago

Thanks for getting back to me. We're using CoreCLR. We referred to https://learn.microsoft.com/zh-cn/dotnet/core/diagnostics/collect-dumps-crash to set up crash dumps. I'll keep you posted with any further updates.

JackJiang1234 commented 1 month ago

i got the crash dump, but i can't find any crash info.
1727148554369 1727148615707 do you have any suggest? thank you

jkotas commented 1 month ago

This is low-level runtime crash. dotnet-dump won't be able to diagnose it. dotnet-dump works for managed crashes only.

Could you please open the crash dump in lldb debugger on the Linux distro where it crashed, and get the stacktrace?

JackJiang1234 commented 1 month ago

thanks for response , i will try the lldb deubgger.