Take dump_stacktrace into use

MaxScale and tests now both use the same code to dump stacktraces.
This commit is contained in:
Markus Mäkelä
2018-06-19 15:11:23 +03:00
parent c32e6a7c3f
commit 3d8f946e19
3 changed files with 12 additions and 115 deletions

View File

@ -8,12 +8,15 @@
#include <execinfo.h>
#include <sys/stat.h>
#include <sstream>
#include <maxbase/stacktrace.hh>
#include "mariadb_func.h"
#include "maxadmin_operations.h"
#include "sql_t1.h"
#include "testconnections.h"
using namespace mxb;
namespace maxscale
{
static bool start = true;
@ -37,9 +40,7 @@ static void signal_set(int sig, void (*handler)(int))
void sigfatal_handler(int i)
{
void *addrs[128];
int count = backtrace(addrs, 128);
backtrace_symbols_fd(addrs, count, STDERR_FILENO);
dump_stacktrace();
signal_set(i, SIG_DFL);
raise(i);
}