From 22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Fri, 15 Jan 2021 20:39:45 +0000 Subject: Print stack trace on assert() failure or when calling fatal_error() Note: this uses the __sanitizer_print_stack_trace() function from the AddressSanitizer runtime, so it only works when AddressSanitizer is in use. --- xmalloc.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'xmalloc.c') diff --git a/xmalloc.c b/xmalloc.c index a9a6685c..8fb78f49 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -1,21 +1,11 @@ -#include #include #include #include #include #include #include -#include #include "xmalloc.h" - -static NORETURN COLD void -fatal_error(const char *msg, int err) -{ - syslog(LOG_ERR, "%s: %s", msg, strerror(err)); - errno = err; - perror(msg); - abort(); -} +#include "debug.h" static void * check_alloc(void *alloc) -- cgit v1.3