From 44f43e5d4ece85d05376c690263eea05e11e4174 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Tue, 8 Dec 2015 18:58:30 -0800 Subject: Disable h/w exceptions for coreclr (non-DAC) builds. Fixes the recursive GC crash. Added FEATURE_ENABLE_HARDWARE_EXCEPTIONS to the PAL sxs exception tests so the h/w exceptions generated by the test dlls are caught. Also added to SOS/strike project. Also fixed sos "clrstack -i". The sos data target needed to implement ICorDebugDataTarget4::VirtualUnwind too. --- src/pal/inc/pal.h | 8 +++++++- src/pal/src/exception/seh.cpp | 1 - .../palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/pal') diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index 0bf1fb6de5..c0c9ba70bc 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -6744,6 +6744,11 @@ public: static bool IsEnabled(); }; +// +// NOTE: Catching hardware exceptions are only enabled in the DAC and SOS +// builds. A hardware exception in coreclr code will fail fast/terminate +// the process. +// #ifdef FEATURE_ENABLE_HARDWARE_EXCEPTIONS #define HardwareExceptionHolder CatchHardwareExceptionHolder __catchHardwareException; #else @@ -6760,7 +6765,7 @@ extern "C++" { // filter to be called during the first pass to better emulate SEH // the xplat platforms that only have C++ exception support. // -class NativeExceptionHolderBase : CatchHardwareExceptionHolder +class NativeExceptionHolderBase { // Save the address of the holder head so the destructor // doesn't have access the slow (on Linux) TLS value again. @@ -6870,6 +6875,7 @@ public: }; \ try \ { \ + HardwareExceptionHolder \ auto __exceptionHolder = NativeExceptionHolderFactory::CreateHolder(&exceptionFilter); \ __exceptionHolder.Push(); \ tryBlock(__param); \ diff --git a/src/pal/src/exception/seh.cpp b/src/pal/src/exception/seh.cpp index 22f8aef499..87bc677296 100644 --- a/src/pal/src/exception/seh.cpp +++ b/src/pal/src/exception/seh.cpp @@ -263,7 +263,6 @@ __declspec(thread) static NativeExceptionHolderBase *t_nativeExceptionHolderHead = nullptr; NativeExceptionHolderBase::NativeExceptionHolderBase() - : CatchHardwareExceptionHolder() { m_head = nullptr; m_next = nullptr; diff --git a/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt index 949fe9294a..fd9af67414 100644 --- a/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt +++ b/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2) set(CMAKE_INCLUDE_CURRENT_DIR ON) if(CLR_CMAKE_PLATFORM_UNIX) - add_compile_options(-fPIC) + add_compile_options(-fPIC) + add_definitions(-DFEATURE_ENABLE_HARDWARE_EXCEPTIONS) endif(CLR_CMAKE_PLATFORM_UNIX) # Test DLL1 -- cgit v1.2.3