summaryrefslogtreecommitdiff
path: root/src/vm/exceptionhandling.cpp
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2015-10-08 14:41:56 +0200
committerJan Vorlicek <janvorli@microsoft.com>2015-10-08 14:41:56 +0200
commit253309471774373c3404818c7be2c5268597ff59 (patch)
treec0de87636e88ebe32138baa88f58a6bee3adc528 /src/vm/exceptionhandling.cpp
parent8ee9ca8eacd9f9ba705707f23dfb3b381c9f2475 (diff)
downloadcoreclr-253309471774373c3404818c7be2c5268597ff59.tar.gz
coreclr-253309471774373c3404818c7be2c5268597ff59.tar.bz2
coreclr-253309471774373c3404818c7be2c5268597ff59.zip
Add high level unhandled exception trap
After the recent exception handling changes, we were missing a high level exception trap in the ExecuteAssembly. While it was fine for exceptions comming from or through managed code, it was a problem for exceptions happening in the ExecuteAssembly call chain before the managed code was called. So for example when ExecuteAssembly was called for assembly that didn't have proper file access rights for the current user, the PAL_SEHException leaked out of the host app (corerun) and the C++ runtime displayed message like this: libc++abi.dylib: terminating with uncaught exception of type PAL_SEHException Abort trap: 6 The fix is to put back the unhandled managed exception trap that I've removed with the recent exception handling changes, but to implement it in a slightly different way - to contain exception holder. This way, the call to InternalUnhandledExceptionFilter_Worker can be removed from the UnwindManagedExceptionPass1, since this new trap would ensure it is called for both the case when the one in UnwindManagedExceptionPass1 would kick in and the case that this issue is fixing.
Diffstat (limited to 'src/vm/exceptionhandling.cpp')
-rw-r--r--src/vm/exceptionhandling.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp
index 6a4d4d70c3..20035adbb0 100644
--- a/src/vm/exceptionhandling.cpp
+++ b/src/vm/exceptionhandling.cpp
@@ -4623,11 +4623,8 @@ VOID DECLSPEC_NORETURN UnwindManagedExceptionPass1(PAL_SEHException& ex)
if (controlPc == 0)
{
- if (!GetThread()->HasThreadStateNC(Thread::TSNC_ProcessedUnhandledException))
- {
- LONG disposition = InternalUnhandledExceptionFilter_Worker(&ex.ExceptionPointers);
- _ASSERTE(disposition == EXCEPTION_CONTINUE_SEARCH);
- }
+ // The unhandled exceptions should be caught by the high level exception filter
+ _ASSERTE(!"UnwindManagedExceptionPass1: Exception escaped the stack");
EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE);
}