Better crash messages

This commit is contained in:
Nicolas Viennot 2019-11-10 03:59:12 -05:00
parent 2b86031308
commit 86ec8d1ad6

View File

@ -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)