From 86ec8d1ad6f00b28ae9c20c6e3d0d2256d5336d2 Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Sun, 10 Nov 2019 03:59:12 -0500 Subject: [PATCH] Better crash messages --- tmate-debug.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tmate-debug.c b/tmate-debug.c index 59e8fe7d..8b4ddd5b 100644 --- a/tmate-debug.c +++ b/tmate-debug.c @@ -88,9 +88,13 @@ void tmate_print_stack_trace(void) static void handle_crash(__unused int sig) { /* TODO send stack trace to server */ - tmate_info("CRASH, printing stack trace"); + const char *what = sig == SIGSEGV ? "SIGSEGV" : "SIGABRT"; + tmate_info("%s printing stack trace", what); tmate_print_stack_trace(); - tmate_fatal("CRASHED"); + + /* Reraise */ + signal(sig, NULL); + kill(getpid(), sig); } void tmate_catch_sigsegv(void)