Skip to content

add replace enforce with glog switch for debug#11244

Merged
Superjomn merged 3 commits intoPaddlePaddle:developfrom
Superjomn:feature/glog
Jun 30, 2018
Merged

add replace enforce with glog switch for debug#11244
Superjomn merged 3 commits intoPaddlePaddle:developfrom
Superjomn:feature/glog

Conversation

@Superjomn
Copy link
Contributor

@Superjomn Superjomn commented Jun 6, 2018

the PADDLE_ENFORCE's exception

image

GLOG error:

image

with gdb, there is

image

The more clear error stack with line number is provided, easier for debugging.

@Superjomn Superjomn changed the title add replace enforce with glog switch for debug Jun 7, 2018
@jacquesqiao
Copy link
Member

Please run with gdb and enforce and see if we can also see the message with line number.

@tensor-tang
Copy link
Contributor

We can get the line message if we have the core dump file.

Only we use root or docker to generate this file.

@Superjomn
Copy link
Contributor Author

Superjomn commented Jun 7, 2018

Run the program in gdb with exception cannot get any call stack calling bt command. @jacquesqiao

@Superjomn Superjomn changed the title WIP add replace enforce with glog switch for debug Jun 30, 2018
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

endif()
endif()

if (REPLACE_ENFORCE_GLOG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put into configure.cmake?

} \
} while (false)
#else
#define PADDLE_ENFORCE(...) ::paddle::platform::throw_on_error(__VA_ARGS__);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方为何去掉了try, catch部分?


template <typename... Args>
std::string Sprintf(const char* fmt, const Args&... args) {
std::string Sprintf(const char* fmt = "", const Args&... args) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认参数一般是最后一个吧?

@Superjomn Superjomn merged commit 28172bb into PaddlePaddle:develop Jun 30, 2018
@Superjomn Superjomn deleted the feature/glog branch June 30, 2018 12:34
kuke pushed a commit to kuke/Paddle that referenced this pull request Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants