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
* Fix unhandled exception reporting corner cases
There are several issues with processing exceptions that are not handled
by managed code on Windows:
* Sometimes the AppDomain.UnhandledException event is sent multiple
times
* Exception flowing to foreign native code is reported as unhandled even
when it is actually caught by the native code
* In rare cases, the unhandled exception stack trace is doubled
This change fixes them by not reporting the unhandled exception in the
SfiNext on Windows. It just raises the underlying SEH exception there
with the thread marked so that the personality routines for the managed
frames won't run the managed exception handling code. If the exception
is truly unhandled, the `InternalUnhandledExceptionFilter_Worker` will be
called by the unhandled exception filter installed for the process and
report the exception as unhandled.
If that exception ends up being caught by a foreign native code, then
nothing will be reported.
Close#115215
* Ensure AppDomain.CurrentDomain.UnhandledException occurs before finally
if (isNotHandledByRuntime && IsExceptionFromManagedCode(pTopExInfo->m_ptrs.ExceptionRecord))
4026
4015
{
4027
-
EH_LOG((LL_INFO100, "SfiNext (pass %d): no more managed frames on the stack, the exception is unhandled", pTopExInfo->m_passNumber));
4016
+
EH_LOG((LL_INFO100, "SfiNext (pass %d): no more managed frames on the stack, the exception is not handled by the runtime\n", pTopExInfo->m_passNumber));
4028
4017
if (pTopExInfo->m_passNumber == 1)
4029
4018
{
4030
-
LONG disposition = InternalUnhandledExceptionFilter_Worker((EXCEPTION_POINTERS *)&pTopExInfo->m_ptrs);
0 commit comments