Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
572adccd
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
572adccd
编写于
8月 12, 2021
作者:
C
Chen Weihang
提交者:
GitHub
8月 12, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove incorrect signal error stack trace (#34842)
* remove unmatched signal error stack * fix error writing for cond
上级
dc62a227
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
6 deletion
+23
-6
paddle/fluid/platform/enforce.h
paddle/fluid/platform/enforce.h
+12
-5
paddle/fluid/platform/init.cc
paddle/fluid/platform/init.cc
+11
-1
未找到文件。
paddle/fluid/platform/enforce.h
浏览文件 @
572adccd
...
@@ -270,12 +270,14 @@ inline std::string SimplifyDemangleStr(std::string str) {
...
@@ -270,12 +270,14 @@ inline std::string SimplifyDemangleStr(std::string str) {
return
str
;
return
str
;
}
}
inline
std
::
string
GetCurrentTraceBackString
()
{
inline
std
::
string
GetCurrentTraceBackString
(
bool
for_signal
=
false
)
{
std
::
ostringstream
sout
;
std
::
ostringstream
sout
;
sout
<<
"
\n\n
--------------------------------------
\n
"
;
if
(
!
for_signal
)
{
sout
<<
"C++ Traceback (most recent call last):"
;
sout
<<
"
\n\n
--------------------------------------
\n
"
;
sout
<<
"
\n
--------------------------------------
\n
"
;
sout
<<
"C++ Traceback (most recent call last):"
;
sout
<<
"
\n
--------------------------------------
\n
"
;
}
#if !defined(_WIN32) && !defined(PADDLE_WITH_MUSL)
#if !defined(_WIN32) && !defined(PADDLE_WITH_MUSL)
static
constexpr
int
TRACE_STACK_LIMIT
=
100
;
static
constexpr
int
TRACE_STACK_LIMIT
=
100
;
...
@@ -284,7 +286,12 @@ inline std::string GetCurrentTraceBackString() {
...
@@ -284,7 +286,12 @@ inline std::string GetCurrentTraceBackString() {
auto
symbols
=
backtrace_symbols
(
call_stack
,
size
);
auto
symbols
=
backtrace_symbols
(
call_stack
,
size
);
Dl_info
info
;
Dl_info
info
;
int
idx
=
0
;
int
idx
=
0
;
for
(
int
i
=
size
-
1
;
i
>=
0
;
--
i
)
{
// `for_signal` used to remove the stack trace introduced by
// obtaining the error stack trace when the signal error occurred,
// that is not related to the signal error self, remove it to
// avoid misleading users and developers
int
end_idx
=
for_signal
?
2
:
0
;
for
(
int
i
=
size
-
1
;
i
>=
end_idx
;
--
i
)
{
if
(
dladdr
(
call_stack
[
i
],
&
info
)
&&
info
.
dli_sname
)
{
if
(
dladdr
(
call_stack
[
i
],
&
info
)
&&
info
.
dli_sname
)
{
auto
demangled
=
demangle
(
info
.
dli_sname
);
auto
demangled
=
demangle
(
info
.
dli_sname
);
std
::
string
path
(
info
.
dli_fname
);
std
::
string
path
(
info
.
dli_fname
);
...
...
paddle/fluid/platform/init.cc
浏览文件 @
572adccd
...
@@ -294,7 +294,17 @@ void SignalHandle(const char *data, int size) {
...
@@ -294,7 +294,17 @@ void SignalHandle(const char *data, int size) {
// Here does not throw an exception,
// Here does not throw an exception,
// otherwise it will casue "terminate called recursively"
// otherwise it will casue "terminate called recursively"
std
::
ostringstream
sout
;
std
::
ostringstream
sout
;
sout
<<
platform
::
GetCurrentTraceBackString
();
sout
<<
"
\n\n
--------------------------------------
\n
"
;
sout
<<
"C++ Traceback (most recent call last):"
;
sout
<<
"
\n
--------------------------------------
\n
"
;
auto
traceback
=
platform
::
GetCurrentTraceBackString
(
/*for_signal=*/
true
);
if
(
traceback
.
empty
())
{
sout
<<
"No stack trace in paddle, may be caused by external reasons.
\n
"
;
}
else
{
sout
<<
traceback
;
}
sout
<<
"
\n
----------------------
\n
Error Message "
sout
<<
"
\n
----------------------
\n
Error Message "
"Summary:
\n
----------------------
\n
"
;
"Summary:
\n
----------------------
\n
"
;
sout
<<
platform
::
errors
::
Fatal
(
sout
<<
platform
::
errors
::
Fatal
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录