To avoid that kind of crash, ignore SIGABRT after starting coreclr shutdown.
struct sigaction sig_abrt_old;
static bool checkOnSigabrt = false;
struct sigaction sig_abrt_old;
static bool checkOnSigabrt = false;
+static bool checkOnTerminate = false;
static void onSigabrt(int signum)
{
// use unused variable to avoid build warning
ssize_t ret = write(STDERR_FILENO, "onSigabrt called\n", 17);
static void onSigabrt(int signum)
{
// use unused variable to avoid build warning
ssize_t ret = write(STDERR_FILENO, "onSigabrt called\n", 17);
+ if (checkOnTerminate) {
+ ret = write(STDERR_FILENO, "onSigabrt called while terminate. go to exit\n", 45);
+ _unused(ret);
+ exit(0);
+ }
+
if (checkOnSigabrt) {
ret = write(STDERR_FILENO, "onSigabrt called again. go to exit\n", 35);
_unused(ret);
if (checkOnSigabrt) {
ret = write(STDERR_FILENO, "onSigabrt called again. go to exit\n", 35);
_unused(ret);
void CoreRuntime::dispose()
{
void CoreRuntime::dispose()
{
+ // call finalize plugin callback before shutdown coreclr
+ finalizePluginManager();
+
+ // ignore the signal generated by an exception that occurred during shutdown
+ checkOnTerminate = true;
+
if (__hostHandle != nullptr) {
int st = shutdown(__hostHandle, __domainId);
if (st < 0)
if (__hostHandle != nullptr) {
int st = shutdown(__hostHandle, __domainId);
if (st < 0)
__coreclrLib = nullptr;
}
__coreclrLib = nullptr;
}
- finalizePluginManager();
finalizePathManager();
__envList.clear();
finalizePathManager();
__envList.clear();