提交 08e6d9a2 编写于 作者: D dapan1121

enh: write coredump bt to log file

上级 5441dae3
......@@ -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;
......
......@@ -823,3 +823,31 @@ 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);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册