* [Local GC] Redirect fatal errors to the EE
* Address code review feedback: don't fetch the IP when reporting a fatal error
Commit migrated from https://github.com/dotnet/coreclr/commit/
b04644c55ae003bd1c6c8fefe33d5dfe6ef240f0
static void StompWriteBarrier(WriteBarrierParameters* args);
static void EnableFinalization(bool foundFinalizers);
+
+ static void HandleFatalError(unsigned int exitCode);
};
#endif // __GCENV_EE_H__
// risks. This happens very rarely and fixing it in the
// way so that we can continue is a bit involved and will
// not be done in Dev10.
- EEPOLICY_HANDLE_FATAL_ERROR(CORINFO_EXCEPTION_GC);
+ GCToEEInterface::HandleFatalError(CORINFO_EXCEPTION_GC);
}
}
#else
STRESS_LOG0(LF_GC, LL_ALWAYS, "Thread::CommitThreadStack failed.");
_ASSERTE(!"Thread::CommitThreadStack failed.");
- EEPOLICY_HANDLE_FATAL_ERROR(COR_E_STACKOVERFLOW);
+ GCToEEInterface::HandleFatalError(COR_E_STACKOVERFLOW);
#endif //BACKGROUND_GC
}
#endif // FEATURE_REDHAWK
g_theGCToCLR->EnableFinalization(foundFinalizers);
}
+ALWAYS_INLINE void GCToEEInterface::HandleFatalError(unsigned int exitCode)
+{
+ assert(g_theGCToCLR != nullptr);
+ g_theGCToCLR->HandleFatalError(exitCode);
+}
+
#undef ALWAYS_INLINE
#endif // __GCTOENV_EE_STANDALONE_INL__
// be finalized.
virtual
void EnableFinalization(bool foundFinalizers) = 0;
+
+ // Signals to the EE that the GC encountered a fatal error and can't recover.
+ virtual
+ void HandleFatalError(unsigned int exitCode) = 0;
};
#endif // _GCINTERFACE_EE_H_
// TODO: Implement for finalization
}
+void GCToEEInterface::HandleFatalError(unsigned int exitCode)
+{
+ abort();
+}
+
bool IsGCSpecialThread()
{
// TODO: Implement for background GC
}
}
+void GCToEEInterface::HandleFatalError(unsigned int exitCode)
+{
+ EEPOLICY_HANDLE_FATAL_ERROR(exitCode);
+}
void StompWriteBarrier(WriteBarrierParameters* args);
void EnableFinalization(bool foundFinalizers);
+ void HandleFatalError(unsigned int exitCode);
};
#endif // FEATURE_STANDALONE_GC