#define ASSERTE_ALL_BUILDS(expr) _ASSERTE_ALL_BUILDS((expr))
+#ifdef TARGET_UNIX
+#define NO_HOSTING_API_FRAME_ADDRESS ((void*)ULONG_PTR_MAX)
+void* g_hostingApiFrameAddress = NO_HOSTING_API_FRAME_ADDRESS;
+
+class HostingApiFrameHolder
+{
+public:
+ HostingApiFrameHolder(void* frameAddress)
+ {
+ g_hostingApiFrameAddress = frameAddress;
+ }
+
+ ~HostingApiFrameHolder()
+ {
+ g_hostingApiFrameAddress = NO_HOSTING_API_FRAME_ADDRESS;
+ }
+};
+#endif // TARGET_UNIX
+
// Holder for const wide strings
typedef NewArrayHolder<const WCHAR> ConstWStringHolder;
PInvokeOverrideFn* pinvokeOverride = nullptr;
host_runtime_contract* hostContract = nullptr;
+#ifdef TARGET_UNIX
+ HostingApiFrameHolder apiFrameHolder(__builtin_frame_address(0));
+#endif
+
ConvertConfigPropertiesToUnicode(
propertyKeys,
propertyValues,
}
*exitCode = -1;
+#ifdef TARGET_UNIX
+ HostingApiFrameHolder apiFrameHolder(__builtin_frame_address(0));
+#endif
+
ICLRRuntimeHost4* host = reinterpret_cast<ICLRRuntimeHost4*>(hostHandle);
ConstWStringArrayHolder argvW;
EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE);
}
+extern void* g_hostingApiFrameAddress;
+
//---------------------------------------------------------------------------------------
//
// This functions performs dispatching of a managed exception.
STRESS_LOG2(LF_EH, LL_INFO100, "Processing exception at native frame: IP = %p, SP = %p \n", controlPc, sp);
- if (controlPc == 0)
+ // Consider the exception unhandled if the unwinding cannot proceed further or if it went past the coreclr_initialize or coreclr_execute_assembly
+ if ((controlPc == 0) || (sp > (UINT_PTR)g_hostingApiFrameAddress))
{
if (!GetThread()->HasThreadStateNC(Thread::TSNC_ProcessedUnhandledException))
{