[exception] pass signal as string already to mono_handle_native_sigsegv
authorBernhard Urban <bernhard.urban@xamarin.com>
Mon, 12 Dec 2016 14:28:41 +0000 (15:28 +0100)
committerBernhard Urban <bernhard.urban@xamarin.com>
Wed, 14 Dec 2016 11:43:51 +0000 (12:43 +0100)
mono/mini/exceptions-amd64.c
mono/mini/exceptions-ppc.c
mono/mini/exceptions-x86.c
mono/mini/mini-exceptions.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini.h

index d0acb219f8ecac67dd728e2122ce77582725d61e..304135e6c9f736bf6fd16fdfabfc25d9e1003be3 100644 (file)
@@ -58,7 +58,7 @@ static LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep)
        }
 #endif
 
-       mono_handle_native_sigsegv (SIGSEGV, NULL, NULL);
+       mono_handle_native_sigsegv ("SIGSEGV", NULL, NULL);
 
        return EXCEPTION_CONTINUE_SEARCH;
 }
@@ -777,7 +777,7 @@ altstack_handle_and_restore (MonoContext *ctx, MonoObject *obj, gboolean stack_o
        MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), MONO_CONTEXT_GET_IP (ctx), NULL);
 
        if (!ji)
-               mono_handle_native_sigsegv (SIGSEGV, NULL, NULL);
+               mono_handle_native_sigsegv ("SIGSEGV", NULL, NULL);
 
        mctx = *ctx;
 
index 684d2d9a469a757f36deb86e1d0702c018b23458..238de08741238dd23de5dc71ed5ddc7520f32724 100644 (file)
@@ -666,7 +666,7 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
                abort ();
        }
        if (!ji)
-               mono_handle_native_sigsegv (SIGSEGV, sigctx, siginfo);
+               mono_handle_native_sigsegv ("SIGSEGV", sigctx, siginfo);
        /* setup a call frame on the real stack so that control is returned there
         * and exception handling can continue.
         * The frame looks like:
index fe0957fa3f2a1a750ff8405a9b7e824a1c333c1e..f2943c89ed13ec9577cba83860b3034b1aff7757 100644 (file)
@@ -62,7 +62,7 @@ LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep)
        }
 #endif
 
-       mono_handle_native_sigsegv (SIGSEGV, NULL, NULL);
+       mono_handle_native_sigsegv ("SIGSEGV", NULL, NULL);
 
        return EXCEPTION_CONTINUE_SEARCH;
 }
@@ -1112,7 +1112,7 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
        if (stack_ovf)
                exc = mono_domain_get ()->stack_overflow_ex;
        if (!ji)
-               mono_handle_native_sigsegv (SIGSEGV, sigctx, siginfo);
+               mono_handle_native_sigsegv ("SIGSEGV", sigctx, siginfo);
        /* setup a call frame on the real stack so that control is returned there
         * and exception handling can continue.
         * If this was a stack overflow the caller already ensured the stack pages
index 789067ac03c421f82f5abc36e5622467971bb956..cc51f5439277e01354e92fa644abe8287fb03dc4 100644 (file)
@@ -2431,13 +2431,12 @@ static gboolean handling_sigsegv = FALSE;
  * information and aborting.
  */
 void
-mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info)
+mono_handle_native_sigsegv (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info)
 {
 #ifdef MONO_ARCH_USE_SIGACTION
        struct sigaction sa;
 #endif
        MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id);
-       const char *signal_str = (signal == SIGSEGV) ? "SIGSEGV" : "SIGABRT";
 
        if (handling_sigsegv)
                return;
@@ -2532,7 +2531,7 @@ mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *i
                         "a fatal error in the mono runtime or one of the native libraries \n"
                         "used by your application.\n"
                         "=================================================================\n",
-                       signal_str);
+                       signal);
 
 
 #ifdef MONO_ARCH_USE_SIGACTION
@@ -2559,7 +2558,7 @@ mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *i
 #else
 
 void
-mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info)
+mono_handle_native_sigsegv (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info)
 {
        g_assert_not_reached ();
 }
index dad5d86218e2a184d445fe64aea229ec4526a673..7f3082be2c04dc417c6d8bd40d0c709cb5676dfb 100644 (file)
@@ -220,7 +220,7 @@ MONO_SIG_HANDLER_FUNC (static, sigabrt_signal_handler)
        if (!ji) {
         if (mono_chain_signal (MONO_SIG_HANDLER_PARAMS))
                        return;
-               mono_handle_native_sigsegv (SIGABRT, ctx, info);
+               mono_handle_native_sigsegv ("SIGABRT", ctx, info);
        }
 }
 
index 0a624ee06351908827503a62314829520ce68710..932b859facda3264361f05def92a6ceb421e953b 100644 (file)
@@ -2850,7 +2850,7 @@ MONO_SIG_HANDLER_FUNC (, mono_sigfpe_signal_handler)
                if (!mono_do_crash_chaining && mono_chain_signal (MONO_SIG_HANDLER_PARAMS))
                        return;
 
-               mono_handle_native_sigsegv (SIGSEGV, ctx, info);
+               mono_handle_native_sigsegv ("SIGFPE", ctx, info);
                if (mono_do_crash_chaining) {
                        mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
                        return;
@@ -2916,7 +2916,7 @@ MONO_SIG_HANDLER_FUNC (, mono_sigsegv_signal_handler)
        if (!mono_domain_get () || !jit_tls) {
                if (!mono_do_crash_chaining && mono_chain_signal (MONO_SIG_HANDLER_PARAMS))
                        return;
-               mono_handle_native_sigsegv (SIGSEGV, ctx, info);
+               mono_handle_native_sigsegv ("SIGSEGV", ctx, info);
                if (mono_do_crash_chaining) {
                        mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
                        return;
@@ -2963,7 +2963,7 @@ MONO_SIG_HANDLER_FUNC (, mono_sigsegv_signal_handler)
                if (!mono_do_crash_chaining && mono_chain_signal (MONO_SIG_HANDLER_PARAMS))
                        return;
 
-               mono_handle_native_sigsegv (SIGSEGV, ctx, info);
+               mono_handle_native_sigsegv ("SIGSEGV", ctx, info);
 
                if (mono_do_crash_chaining) {
                        mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
index b3eb72a0d3f0ec7cc9a843113eaf48695b7c40c3..a4b2cb23dc1d7dbcb4a326e89796029bc400ab9f 100644 (file)
@@ -2850,7 +2850,7 @@ typedef gboolean (*MonoJitStackWalk)            (StackFrameInfo *frame, MonoCont
 
 void     mono_exceptions_init                   (void);
 gboolean mono_handle_exception                  (MonoContext *ctx, MonoObject *obj);
-void     mono_handle_native_sigsegv             (int signal, void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *siginfo);
+void     mono_handle_native_sigsegv             (const char *signal, void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *siginfo);
 MONO_API void     mono_print_thread_dump                 (void *sigctx);
 MONO_API void     mono_print_thread_dump_from_ctx        (MonoContext *ctx);
 void     mono_walk_stack_with_ctx               (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data);