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

Do not append stacktrace to the message when throwing a std::runtime_error #4671

Merged
merged 5 commits into from
Jan 14, 2022

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented Jan 13, 2022

We used to include the call stack in the error message when throwing a runtime exception but it looks like we accidentally unconditionally disabled the functionality in the refactor #2226

EDIT decided to strip the stacktrace from the error message since it can be obtained on the user side when handling the error

@dalg24 dalg24 requested a review from ibaned January 13, 2022 13:16
@dalg24
Copy link
Member Author

dalg24 commented Jan 13, 2022

@ibaned please confirm that this was an oversight

@dalg24
Copy link
Member Author

dalg24 commented Jan 13, 2022

The last 3 commits are optional

@dalg24 dalg24 requested a review from cz4rs January 13, 2022 15:29
@ibaned
Copy link
Contributor

ibaned commented Jan 13, 2022

@dalg24 correct, I don't remember a specific reason why this was changed.

ibaned
ibaned previously approved these changes Jan 13, 2022
@dalg24
Copy link
Member Author

dalg24 commented Jan 13, 2022

The last 3 commits are optional

I decided to revert after discussing with Cezary since it was adding a dependency on GMock. We can revisit later.

cz4rs
cz4rs previously approved these changes Jan 13, 2022
Copy link
Contributor

@cz4rs cz4rs left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@dalg24
Copy link
Member Author

dalg24 commented Jan 13, 2022

Retest this please

@dalg24 dalg24 changed the title Re-enable stacktrace functionality when throwing a runtime exception Do not append stacktrace to the message when throwing a std::runtime_error Jan 13, 2022
@dalg24 dalg24 dismissed stale reviews from cz4rs and ibaned January 13, 2022 21:59

Solution proposed changed since the approval

@dalg24
Copy link
Member Author

dalg24 commented Jan 13, 2022

@ibaned @cz4rs I dismissed your reviews since I decided to propose a different resolution after discussing the changes on the developer Slack channel. #4672 appends the current call stack to the error message when calling Kokkos::abort() from the host. We feel like we shouldn't do the same when throwing an exception because the stacktrace can be added on the user side when handling the error and the error message may become unreasonably big.

@crtrott crtrott merged commit 2c1c3e3 into kokkos:develop Jan 14, 2022
@dalg24 dalg24 deleted the reenable_stacktrace branch January 14, 2022 22:29
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.

None yet

4 participants