Skip to content

Commit

Permalink
[mono] Exit early to prevent endless loop when crashing (#105249)
Browse files Browse the repository at this point in the history
We hit an issue where we got into an endless loop of crashes while trying to dump the stack trace.
Move the existing code to protect against this up to make sure we abort early enough.
  • Loading branch information
akoeplinger authored Jul 22, 2024
1 parent 2c70e36 commit 4c21cb3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/mono/mono/mini/mini-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ dump_native_stacktrace (const char *signal, MonoContext *mctx)
g_assertion_disable_global (assert_printer_callback);
} else {
g_async_safe_printf ("\nAn error has occurred in the native fault reporting. Some diagnostic information will be unavailable.\n");

g_async_safe_printf ("\nExiting early due to double fault.\n");
_exit (-1);
}

#ifdef HAVE_BACKTRACE_SYMBOLS
Expand Down Expand Up @@ -847,11 +848,6 @@ dump_native_stacktrace (const char *signal, MonoContext *mctx)
// If we can't fork, do as little as possible before exiting
}

if (double_faulted) {
g_async_safe_printf("\nExiting early due to double fault.\n");
_exit (-1);
}

#endif
#else
#ifdef HOST_ANDROID
Expand Down

0 comments on commit 4c21cb3

Please sign in to comment.