From d1b579386de513a9fce913a1ce0937654550ed4e Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Mon, 6 May 2024 14:29:09 +0200 Subject: [PATCH] Fix handling exceptions on shutdown A recent partial backport of a change to enable propagating exceptions on shutdown was missing two places in the code that were under a different condition than the global exception handling disabling that was removed. I must have made a mistake when testing that change (not setting watson registry settings properly or using a stale build). This change makes it work correctly. --- src/coreclr/vm/excep.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/coreclr/vm/excep.cpp b/src/coreclr/vm/excep.cpp index b88d6a959bb321..9fe9376fd58efa 100644 --- a/src/coreclr/vm/excep.cpp +++ b/src/coreclr/vm/excep.cpp @@ -6696,14 +6696,6 @@ VEH_ACTION WINAPI CLRVectoredExceptionHandlerPhase3(PEXCEPTION_POINTERS pExcepti VEH_ACTION WINAPI CLRVectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo) { - // It is not safe to execute code inside VM after we shutdown EE. One example is DisablePreemptiveGC - // will block forever. - if (g_fForbidEnterEE) - { - return VEH_CONTINUE_SEARCH; - } - - // // DO NOT USE CONTRACTS HERE AS THIS ROUTINE MAY NEVER RETURN. You can use // static contracts, but currently this is all WRAPPER_NO_CONTRACT. @@ -7385,12 +7377,6 @@ LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo) // WARNING WARNING WARNING WARNING WARNING WARNING WARNING // - // If runtime have been disabled, then simply return. - if (g_fForbidEnterEE) - { - return EXCEPTION_CONTINUE_SEARCH; - } - // WARNING // // We must preserve this so that GCStress=4 eh processing doesnt kill last error.