Take dump_stacktrace into use
MaxScale and tests now both use the same code to dump stacktraces.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user