From 5ad70ccc4149f540138514497371c3ce88ba41d6 Mon Sep 17 00:00:00 2001 From: Quantum Date: Fri, 26 Feb 2021 17:56:44 -0500 Subject: [PATCH] [common] crash/linux: generate core dump when handling SIGSEGV Calling abort() instead of exit() will generate a core dump, allowing gdb to be used when the client crashes. This is desirable for the following reasons: 1. gdb can be used to inspect the call stack with far more detail than the our quick stack trace code, and also allows the access to the heap. 2. Our SIGSEGV handler is unable to use debug symbols for shared libraries, making it impossible to debug bugs involving drivers and similar. --- common/src/platform/linux/crash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/platform/linux/crash.c b/common/src/platform/linux/crash.c index 709731b8..05278e9e 100644 --- a/common/src/platform/linux/crash.c +++ b/common/src/platform/linux/crash.c @@ -215,7 +215,7 @@ static void crit_err_hdlr(int sig_num, siginfo_t * info, void * ucontext) DEBUG_ERROR("signal %d (%s), address is %p", sig_num, strsignal(sig_num), info->si_addr); printBacktrace(); cleanupCrashHandler(); - exit(EXIT_FAILURE); + abort(); } bool installCrashHandler(const char * exe)