summaryrefslogtreecommitdiff
path: root/src/vm/exceptionhandling.cpp
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2019-02-22 23:11:14 +0100
committerGitHub <noreply@github.com>2019-02-22 23:11:14 +0100
commit6a392d9084a1afe8b9861138e5d0e5b688deca44 (patch)
treefab830805a42013ec1eb865fcfa1aac12f67d2d5 /src/vm/exceptionhandling.cpp
parentec41a807d2698379e9a1ad0da296898def46c54d (diff)
downloadcoreclr-6a392d9084a1afe8b9861138e5d0e5b688deca44.tar.gz
coreclr-6a392d9084a1afe8b9861138e5d0e5b688deca44.tar.bz2
coreclr-6a392d9084a1afe8b9861138e5d0e5b688deca44.zip
Add fatal error details printing (#22789)
Before this change, we were only printing details on fatal errors with error code COR_E_FAILFAST. For other error codes we were just silently exiting. This change enables printing fatal error details for all kinds of fatal errors.
Diffstat (limited to 'src/vm/exceptionhandling.cpp')
-rw-r--r--src/vm/exceptionhandling.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp
index 6b337bdac4..c5b78c26a4 100644
--- a/src/vm/exceptionhandling.cpp
+++ b/src/vm/exceptionhandling.cpp
@@ -1025,7 +1025,27 @@ ProcessCLRException(IN PEXCEPTION_RECORD pExceptionRecord
// Failfast if exception indicates corrupted process state
if (pTracker->GetCorruptionSeverity() == ProcessCorrupting)
- EEPOLICY_HANDLE_FATAL_ERROR(pExceptionRecord->ExceptionCode);
+ {
+ OBJECTREF oThrowable = NULL;
+ SString message;
+
+ GCPROTECT_BEGIN(oThrowable);
+ oThrowable = pTracker->GetThrowable();
+ if (oThrowable != NULL)
+ {
+ EX_TRY
+ {
+ GetExceptionMessage(oThrowable, message);
+ }
+ EX_CATCH
+ {
+ }
+ EX_END_CATCH(SwallowAllExceptions);
+ }
+ GCPROTECT_END();
+
+ EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(pExceptionRecord->ExceptionCode, (LPCWSTR)message);
+ }
}
#endif // FEATURE_CORRUPTING_EXCEPTIONS