Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
47125b5d
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
47125b5d
编写于
1月 04, 2023
作者:
D
dapan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: windows crash report issues
上级
d260d759
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
9 deletion
+31
-9
include/os/osSystem.h
include/os/osSystem.h
+6
-6
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+17
-1
source/util/src/tlog.c
source/util/src/tlog.c
+8
-2
未找到文件。
include/os/osSystem.h
浏览文件 @
47125b5d
...
...
@@ -102,10 +102,10 @@ void taosResetTerminalMode();
symbol->SizeOfStruct = sizeof(SYMBOL_INFO); \
\
if (frames > 0) { \
offset = snprintf(buf, bufSize - 1, "obtained %d stack frames", frames); \
for (i = 0; i < frames; i++) { \
offset = snprintf(buf, bufSize - 1, "obtained %d stack frames",
(ignoreNum > 0) ? frames - ignoreNum :
frames); \
for (i =
(ignoreNum > 0) ? ignoreNum :
0; i < frames; i++) { \
SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); \
offset += snprintf(buf + offset, bufSize - 1 - offset, "frame:%i, %s - 0x%0X",
frames - i - 1
, symbol->Name, symbol->Address); \
offset += snprintf(buf + offset, bufSize - 1 - offset, "frame:%i, %s - 0x%0X",
(ignoreNum > 0) ? i - ignoreNum : i
, symbol->Name, symbol->Address); \
} \
} \
free(symbol); \
...
...
@@ -131,10 +131,10 @@ void taosResetTerminalMode();
symbol->SizeOfStruct = sizeof(SYMBOL_INFO); \
\
if (frames > 0) { \
taosPrintLog(flags, level, dflag, "obtained %d stack frames", frames); \
for (i = 0; i < frames; i++) { \
taosPrintLog(flags, level, dflag, "obtained %d stack frames",
(ignoreNum > 0) ? frames - ignoreNum :
frames); \
for (i =
(ignoreNum > 0) ? ignoreNum :
0; i < frames; i++) { \
SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); \
taosPrintLog(flags, level, dflag, "frame:%i, %s - 0x%0X",
frames - i - 1
, symbol->Name, symbol->Address); \
taosPrintLog(flags, level, dflag, "frame:%i, %s - 0x%0X",
(ignoreNum > 0) ? i - ignoreNum : i
, symbol->Name, symbol->Address); \
} \
} \
free(symbol); \
...
...
source/client/src/clientEnv.c
浏览文件 @
47125b5d
...
...
@@ -419,8 +419,14 @@ void taosClientCrash(int signum, void *sigInfo, void *context) {
_return:
taosLogCrashInfo
(
"taos"
,
pMsg
,
msgLen
,
signum
,
sigInfo
);
#if defined(WINDOWS)
exit
(
signum
);
#endif
}
void
crashReportThreadFuncUnexpectedStopped
(
void
)
{
atomic_store_32
(
&
clientStop
,
-
1
);
}
static
void
*
tscCrashReportThreadFp
(
void
*
param
)
{
setThreadName
(
"client-crashReport"
);
char
filepath
[
PATH_MAX
]
=
{
0
};
...
...
@@ -432,6 +438,12 @@ static void *tscCrashReportThreadFp(void *param) {
int32_t
sleepTime
=
200
;
int32_t
reportPeriodNum
=
3600
*
1000
/
sleepTime
;
int32_t
loopTimes
=
reportPeriodNum
;
#ifdef WINDOWS
if
(
taosCheckCurrentInDll
())
{
atexit
(
crashReportThreadFuncUnexpectedStopped
);
}
#endif
while
(
1
)
{
if
(
clientStop
)
break
;
...
...
@@ -499,7 +511,11 @@ void tscStopCrashReport() {
return
;
}
clientStop
=
1
;
if
(
atomic_val_compare_exchange_32
(
&
clientStop
,
0
,
1
))
{
tscDebug
(
"hb thread already stopped"
);
return
;
}
while
(
atomic_load_32
(
&
clientStop
)
>
0
)
{
taosMsleep
(
100
);
}
...
...
source/util/src/tlog.c
浏览文件 @
47125b5d
...
...
@@ -866,7 +866,12 @@ int32_t taosGenCrashJsonMsg(int signum, char** pMsg, int64_t clusterId, int64_t
tjsonAddIntegerToObject
(
pJson
,
"crashSig"
,
signum
);
tjsonAddIntegerToObject
(
pJson
,
"crashTs"
,
taosGetTimestampUs
());
#if !defined(WINDOWS)
taosLogTraceToBuf
(
tmp
,
sizeof
(
tmp
),
3
);
#else
taosLogTraceToBuf
(
tmp
,
sizeof
(
tmp
),
8
);
#endif
tjsonAddStringToObject
(
pJson
,
"stackInfo"
,
tmp
);
char
*
pCont
=
tjsonToString
(
pJson
);
...
...
@@ -925,9 +930,10 @@ _return:
#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
,
3
);
#else
taosPrintTrace
(
flags
,
level
,
dflag
,
8
);
#endif
taosMemoryFree
(
pMsg
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录