enh: write coredump bt to log file
This commit is contained in:
parent
5441dae3ba
commit
08e6d9a264
|
@ -87,6 +87,8 @@ bool taosAssert(bool condition, const char *file, int32_t line, const char *form
|
|||
#define ASSERTS(condition, ...) taosAssert(condition, __FILE__, __LINE__, __VA_ARGS__)
|
||||
#define ASSERT(condition) ASSERTS(condition, "assert info not provided")
|
||||
|
||||
void taosCrash(int signum, void *sigInfo, void *context);
|
||||
|
||||
// clang-format off
|
||||
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
#define uError(...) { if (uDebugFlag & DEBUG_ERROR) { taosPrintLog("UTL ERROR ", DEBUG_ERROR, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
|
||||
|
|
|
@ -73,12 +73,16 @@ static void dmSetSignalHandle() {
|
|||
taosSetSignal(SIGTERM, dmStopDnode);
|
||||
taosSetSignal(SIGHUP, dmStopDnode);
|
||||
taosSetSignal(SIGINT, dmStopDnode);
|
||||
taosSetSignal(SIGABRT, dmStopDnode);
|
||||
taosSetSignal(SIGBREAK, dmStopDnode);
|
||||
#ifndef WINDOWS
|
||||
taosSetSignal(SIGTSTP, dmStopDnode);
|
||||
taosSetSignal(SIGQUIT, dmStopDnode);
|
||||
#endif
|
||||
|
||||
taosSetSignal(SIGBUS, taosCrash);
|
||||
taosSetSignal(SIGABRT, taosCrash);
|
||||
taosSetSignal(SIGFPE, taosCrash);
|
||||
taosSetSignal(SIGSEGV, taosCrash);
|
||||
}
|
||||
|
||||
static int32_t dmParseArgs(int32_t argc, char const *argv[]) {
|
||||
|
|
|
@ -880,6 +880,9 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
|
|||
bool tbCreated = false;
|
||||
terrno = TSDB_CODE_SUCCESS;
|
||||
|
||||
int32_t tta = 0;
|
||||
int32_t ttt = 1/tta;
|
||||
|
||||
pRsp->code = 0;
|
||||
pSubmitReq->version = version;
|
||||
statis.nBatchInsert = 1;
|
||||
|
|
|
@ -822,4 +822,32 @@ bool taosAssert(bool condition, const char *file, int32_t line, const char *form
|
|||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void taosCrash(int signum, void *sigInfo, void *context) {
|
||||
taosIgnSignal(SIGTERM);
|
||||
taosIgnSignal(SIGHUP);
|
||||
taosIgnSignal(SIGINT);
|
||||
taosIgnSignal(SIGBREAK);
|
||||
|
||||
taosIgnSignal(SIGBUS);
|
||||
taosIgnSignal(SIGABRT);
|
||||
taosIgnSignal(SIGFPE);
|
||||
taosIgnSignal(SIGSEGV);
|
||||
|
||||
const char *flags = "UTL FATAL ";
|
||||
ELogLevel level = DEBUG_FATAL;
|
||||
int32_t dflag = 255;
|
||||
|
||||
taosPrintLog(flags, level, dflag, "crash signal is %d", signum);
|
||||
|
||||
#ifndef WINDOWS
|
||||
taosPrintLog(flags, level, dflag, "sender PID:%d cmdline:%s", ((siginfo_t *)sigInfo)->si_pid,
|
||||
taosGetCmdlineByPID(((siginfo_t *)sigInfo)->si_pid));
|
||||
#endif
|
||||
|
||||
|
||||
taosPrintTrace(flags, level, dflag);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue