Skip to content

Commit 236aaeb

Browse files
committed
DEBUG
1 parent 6e7d5fc commit 236aaeb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

regression/cbmc/Failing_Assert1/z3-wrapper.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
# handle output by older Z3 versions where the output was not compatible with
44
# current SAT solvers
5-
5+
set -vx
6+
echo "Trying to run z3"
7+
z3 --version
8+
z3 $1
69
z3 $1 2>&1 | \
710
perl -n -e '
811
print "s ".uc($1)."ISFIABLE\n" if(/^((un)?sat)\s*$/);

src/solvers/sat/external_sat.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ void external_satt::write_cnf_file(std::string cnf_file)
6262
std::string external_satt::execute_solver(std::string cnf_file)
6363
{
6464
log.status() << "Invoking SAT solver" << messaget::eom;
65+
temporary_filet stderr_file("external-sat", ".log");
6566
std::ostringstream response_ostream;
66-
auto cmd_result = run(solver_cmd, {"", cnf_file}, "", response_ostream, "");
67+
auto cmd_result = run(solver_cmd, {"", cnf_file}, "", response_ostream, stderr_file());
6768

6869
log.status() << "Solver returned code: " << cmd_result << messaget::eom;
70+
std::ifstream stderr_stream{stderr_file()};
71+
response_ostream << stderr_stream.rdbuf();
6972
return response_ostream.str();
7073
}
7174

@@ -159,7 +162,7 @@ external_satt::resultt external_satt::parse_result(std::string solver_output)
159162
return resultt::P_SATISFIABLE;
160163
}
161164

162-
log.error() << "external SAT solver has provided an unexpected response"
165+
log.error() << "external SAT solver has provided an unexpected response: " << solver_output
163166
<< messaget::eom;
164167
return resultt::P_ERROR;
165168
}

src/util/run.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Date: August 2012
4141
#endif
4242

4343
#include <fstream>
44+
#include <iostream>
4445

4546
#include "invariant.h"
4647
#include "signal_catcher.h"
@@ -315,6 +316,7 @@ int run(
315316
// now re-open the file and write the above error message
316317
std::ofstream stderr_stream(std_error);
317318
stderr_stream << windows_error;
319+
std::cerr << "RUN failed: " << windows_error << std::endl;
318320

319321
return -1;
320322
}

0 commit comments

Comments
 (0)