diff --git a/lib/ProxySQL_GloVars.cpp b/lib/ProxySQL_GloVars.cpp index ea7a02948..84fbe2a15 100644 --- a/lib/ProxySQL_GloVars.cpp +++ b/lib/ProxySQL_GloVars.cpp @@ -4,6 +4,7 @@ #include #include #include "SpookyV2.h" +#include static void term_handler(int sig) { proxy_warning("Received TERM signal: shutdown in progress...\n"); @@ -17,6 +18,8 @@ void crash_handler(int sig) { // malloc_stats_print(NULL, NULL, ""); #endif #ifdef __GLIBC__ +#define DEBUG_MSG_MAXSIZE 1024 + char debugbuff[DEBUG_MSG_MAXSIZE]; void *arr[20]; size_t s; @@ -24,6 +27,26 @@ void crash_handler(int sig) { fprintf(stderr, "Error: signal %d:\n", sig); backtrace_symbols_fd(arr, s, STDERR_FILENO); + + char **strings; + strings=backtrace_symbols(arr,s); + if (strings == NULL) { + perror("backtrace_symbols failed!"); + } else { + for (unsigned int i=0; i