Revert "[exceptions] only do SIGSEGV related actions for SIGSEGVs in mono_handle_nati...
authorBernhard Urban <bernhard.urban@xamarin.com>
Wed, 7 Jun 2017 21:07:34 +0000 (23:07 +0200)
committerBernhard Urban <bernhard.urban@xamarin.com>
Tue, 13 Jun 2017 21:43:06 +0000 (23:43 +0200)
This reverts commit a27bc024f1732edb6b1edddd96d6c90f4a2983f8.

We never want the crash handler to be recursive.

mono/mini/mini-exceptions.c

index 7878372c10cd57257517b52809e147cb42c654bf..457517b5e7fe186e8663a1a93104db65a9e56ccb 100644 (file)
@@ -2614,7 +2614,7 @@ static void print_process_map (void)
 #endif
 }
 
-static gboolean handling_sigsegv = FALSE;
+static gboolean handle_crash_loop = FALSE;
 
 /*
  * mono_handle_native_crash:
@@ -2630,9 +2630,7 @@ mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_T
 #endif
        MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_tls_get_jit_tls ();
 
-       gboolean is_sigsegv = !strcmp ("SIGSEGV", signal);
-
-       if (handling_sigsegv && is_sigsegv)
+       if (handle_crash_loop)
                return;
 
        if (mini_get_debug_options ()->suspend_on_native_crash) {
@@ -2647,9 +2645,8 @@ mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_T
 #endif
        }
 
-       /* To prevent infinite loops when the stack walk causes a crash */
-       if (is_sigsegv)
-               handling_sigsegv = TRUE;
+       /* prevent infinite loops in crash handling */
+       handle_crash_loop = TRUE;
 
        /* !jit_tls means the thread was not registered with the runtime */
        if (jit_tls && mono_thread_internal_current ()) {