Skip to content

Commit abf760a

Browse files
committed
DEBUG
1 parent 6e7d5fc commit abf760a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ int run(
315315
// now re-open the file and write the above error message
316316
std::ofstream stderr_stream(std_error);
317317
stderr_stream << windows_error;
318+
std::cerr << "RUN failed: " << windows_error << std::endl;
318319

319320
return -1;
320321
}

0 commit comments

Comments
 (0)