-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add replace enforce with glog switch for debug #11244
Conversation
Please run with gdb and enforce and see if we can also see the message with line number. |
We can get the line message if we have the core dump file. Only we use root or docker to generate this file. |
Run the program in gdb with exception cannot get any call stack calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -131,6 +132,10 @@ if (NOT DEFINED WITH_MKLDNN) | |||
set(WITH_MKLDNN OFF) | |||
endif() | |||
endif() | |||
|
|||
if (REPLACE_ENFORCE_GLOG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put into configure.cmake?
@@ -212,6 +238,9 @@ inline void throw_on_error(T e) { | |||
__FILE__, __LINE__); \ | |||
} \ | |||
} while (false) | |||
#else | |||
#define PADDLE_ENFORCE(...) ::paddle::platform::throw_on_error(__VA_ARGS__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方为何去掉了try, catch部分?
@@ -84,7 +84,7 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) { | |||
} | |||
|
|||
template <typename... Args> | |||
std::string Sprintf(const char* fmt, const Args&... args) { | |||
std::string Sprintf(const char* fmt = "", const Args&... args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认参数一般是最后一个吧?
the
PADDLE_ENFORCE
's exceptionGLOG error:
with gdb, there is
The more clear error stack with line number is provided, easier for debugging.