-
Notifications
You must be signed in to change notification settings - Fork 129
Gracefully exit from kani-driver process #2168
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
Gracefully exit from kani-driver process #2168
Conversation
|
This is at least not the fix I'd do for #2064. I think we should detect when You can see documentation on this environment variable in: https://docs.rs/anyhow/latest/anyhow/ |
|
It makes sense. What you are suggesting is already the current behavior though. The standard library checks those variables before generating the backtrace. That said, it doesn't fix the problem at hand. So I think the question here is whether #2064 should be fixed in the first place. @zhassan-aws ? |
|
I think we should fix it. The behavior I was suggesting is this:
So to fix this in |
|
Ah, I see what you are saying, you think we should change the behavior only when This PR mimics No matter which approach we take, we should consider improving the driver error handling to make a distinction between internal tool error and user error, so this can be handled in a better way. |
I think it should be fixed, because a backtrace gives an impression that something is broken in the tool. |
zhassan-aws
left a comment
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.
A few minor comments. Otherwise, looks good (if @tedinski is OK with the changes).
kani-driver/src/main.rs
Outdated
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.
"consider create" -> "create" or "consider creating"
Pretty much. Also, just want to make it clear: I don't object to this change. |
Yeah, tbh, I am not a big fan of the design they came up with these two variables. It's not very intuitive.
Sounds good. Thanks! |
When an error that was properly handled ocurrs in `kani-driver` we now gracefully exit and return ExitStatus::FAILURE. We still print all error context to keep a similar experiece to what it was before. However, this will no longer include the backtrace if users set RUST_BACKTRACE=1. The backtrace will still be included if you enable the debug logs and also enable the backtrace. I.e.: ``` RUST_BACKTRACE=1 KANI_LOG=kani_driver=debug cargo kani ```
c868ac2 to
42ff192
Compare
Description of changes:
When an error that was properly handled ocurrs in
kani-driverwe now gracefully exit and return ExitStatus::FAILURE.We still print all error context to keep a similar experiece to what it was before. However, this will no longer include the backtrace if users set RUST_BACKTRACE=1.
The backtrace will still be included if you enable the debug logs and also enable the backtrace. I.e.:
Resolved issues:
Resolves #2064
Related RFC:
Optional #ISSUE-NUMBER.
Call-outs:
Testing:
How is this change tested?
Is this a refactor change?
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.