-
Notifications
You must be signed in to change notification settings - Fork 260
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
SMT2 back-end: report error when invoking solver fails #8378
base: develop
Are you sure you want to change the base?
Conversation
Our previous attempt at reporting errors was dead code for `run` never returns a negative value. When the executable isn't found the return code was 1, which is also a legitimate return code when `z3` runs successfully. Thus, use emptiness of `stderr` output as the success criterion, and propagate the messages produced by `run` on stderr to the error-logging output. Fixes: diffblue#8362
2409536
to
7fd93be
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8378 +/- ##
===========================================
- Coverage 78.35% 78.34% -0.01%
===========================================
Files 1726 1726
Lines 188424 188443 +19
Branches 18248 18248
===========================================
- Hits 147631 147630 -1
- Misses 40793 40813 +20 ☔ View full report in Codecov by Sentry. |
Thanks for this one. Have you tested it in the three obvious use cases:
|
OK... build this branch and tried it on the command-line. Issues:
|
I tried this using cbmc-starter-kit and running the tools with litani. With no Z3 installed, the run ends with:
so nothing there about Z3 missing. Secondly, no "report" directory has been created, so nothing to find there in HTML either. The error messages does appear in logs/result.xml but buried on line 45 of a 6000 line file. |
We should likely work on the starter kit to do a better job at testing for dependencies and extracting useful information. This PR enables such work by making CBMC present the information rather than hiding it. |
@@ -135,13 +137,14 @@ decision_proceduret::resultt smt2_dect::dec_solve(const exprt &assumption) | |||
UNREACHABLE; | |||
} | |||
|
|||
int res = | |||
run(argv[0], argv, stdin_filename, temp_file_stdout(), temp_file_stderr()); | |||
run(argv[0], argv, stdin_filename, temp_file_stdout(), temp_file_stderr()); |
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.
Should run
not rather return a proper result?
Our previous attempt at reporting errors was dead code for
run
never returns a negative value. When the executable isn't found the return code was 1, else failures will depend on the solver's return code. Also, propagate the messages produced byrun
on stderr to the error-logging output.Fixes: #8362