diff options
author | Alexander Kyte <alexmkyte@gmail.com> | 2018-10-30 21:23:53 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2018-10-30 21:23:53 +0300 |
commit | 149206a5eed02784f04e1c4d8e470f0d8eedc767 (patch) | |
tree | 25cf7d945d769b160c45f111963fa69418aedfcd | |
parent | 2f2615ffc88241177a55fde6ee5f1456de11e027 (diff) |
[crash] Fix merp invocation (#11436)
The change which made the handler return (rather than crashing the
runtime) did not consider this control flow path that causes the sigterm
signal handler to trigger the merp dumper if we return.
We now always return.
This was previously so that a random sigterm could be used to trigger a
dump. This isn't really used, and won't work right now anyways
(we don't register it until right before we dump). My fix is to remove
it, and to make the signal handler only work as part of the dumper
machinery.
-rw-r--r-- | mono/mini/mini-posix.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/mono/mini/mini-posix.c b/mono/mini/mini-posix.c index 91ac6ae67dd..f524188f99b 100644 --- a/mono/mini/mini-posix.c +++ b/mono/mini/mini-posix.c @@ -222,18 +222,11 @@ MONO_SIG_HANDLER_FUNC (static, sigterm_signal_handler) gchar *output = NULL; MonoStackHash hashes; mono_sigctx_to_monoctx (ctx, &mctx); + // Will return when the dumping is done, so this thread can continue + // running. Returns FALSE on unrecoverable error. if (!mono_threads_summarize_execute (&mctx, &output, &hashes, FALSE, NULL, 0)) g_assert_not_reached (); - if (mono_merp_enabled ()) { - pid_t crashed_pid = getpid (); - mono_merp_invoke (crashed_pid, "SIGTERM", output, &hashes); - } else { - // Controlling thread gets the dump - if (output) - MOSTLY_ASYNC_SAFE_PRINTF("Unhandled exception dump: \n######\n%s\n######\n", output); - } - mono_chain_signal (MONO_SIG_HANDLER_PARAMS); } #endif |