Skip to content
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

Demangle exception call stack for PADDLE_ENFORCE #3463

Merged
merged 3 commits into from
Aug 14, 2017

Conversation

gangliao
Copy link
Contributor

@gangliao gangliao commented Aug 14, 2017

fix #3462

After this PR, if we meet some exceptions like this:

TEST(ENFORCE_USER_DEFINED_CLASS, EQ) {
  Dims a{{1, 3, 3, 4}}, b{{1, 2, 3, 4}};
  PADDLE_ENFORCE_EQ(a, b);
}

Call Stack:

: [ RUN      ] ENFORCE_USER_DEFINED_CLASS.EQ
68: unknown file: Failure
68: C++ exception with description "enforce a == b failed, [1, 3, 3, 4] != [1, 2, 3, 4]
68:  at [/Users/liaogang/baidu/Paddle/paddle/platform/enforce_test.cc:210]
68: PaddlePaddle Call Stacks:
68: 0          0x1051a58e0p paddle::platform::EnforceNotMet::EnforceNotMet(std::exception_ptr, char const*, int) + 768
68: 1          0x1051a4f79p ENFORCE_USER_DEFINED_CLASS_EQ_Test::TestBody() + 377
68: 2          0x1051b957bp void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) + 75
68: 3          0x1051b94cep testing::Test::Run() + 254
68: 4          0x1051ba4e2p testing::TestInfo::Run() + 306
68: 5          0x1051bad73p testing::TestCase::Run() + 275
68: 6          0x1051c2e59p testing::internal::UnitTestImpl::RunAllTests() + 1241
68: 7          0x1051c27c0p bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) + 80
68: 8          0x1051c271ep testing::UnitTest::Run() + 174
68: 9          0x1051d40d1p main + 49
68: 10      0x7fffa9e0c235p start + 1
68: 11                 0x1p " thrown in the test body.
68: [  FAILED  ] ENFORCE_USER_DEFINED_CLASS.EQ (0 ms)

@gangliao gangliao requested a review from wangkuiyi August 14, 2017 07:53
@gangliao gangliao requested a review from reyoung August 14, 2017 08:02
Copy link
Collaborator

@reyoung reyoung left a comment

Choose a reason for hiding this comment

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

LGTM++

@gangliao gangliao merged commit 0c3c609 into PaddlePaddle:develop Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paddle enforce's exception output is hard to read
2 participants