aboutsummaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-03-04 21:13:30 +0100
committerClifford Wolf <clifford@clifford.at>2018-03-04 21:13:30 +0100
commit45a6fce92c595bf406f771c97d5a1de359f465f9 (patch)
tree887b71a84da8cdddd19d9bc3bcc732b0ffb31e9c /backends
parent480e8e676a41559138a690759e90cec2ae60bc28 (diff)
downloadyosys-45a6fce92c595bf406f771c97d5a1de359f465f9.tar.gz
yosys-45a6fce92c595bf406f771c97d5a1de359f465f9.tar.bz2
yosys-45a6fce92c595bf406f771c97d5a1de359f465f9.zip
Fix a hangup in yosys-smtbmc error handling
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'backends')
-rw-r--r--backends/smt2/smtio.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/backends/smt2/smtio.py b/backends/smt2/smtio.py
index e6f80d0ac..184a11817 100644
--- a/backends/smt2/smtio.py
+++ b/backends/smt2/smtio.py
@@ -47,7 +47,7 @@ def sig_handler(signum, frame):
got_term_signal = True
for p in running_solvers.values():
os.killpg(os.getpgid(p.pid), signal.SIGTERM)
- sys.exit(0)
+ sys.exit(1)
signal.signal(signal.SIGINT, sig_handler)
signal.signal(signal.SIGHUP, sig_handler)
@@ -571,12 +571,14 @@ class SmtIo:
if count_brackets == 0:
break
if self.solver != "dummy" and self.p.poll():
- print("SMT Solver terminated unexpectedly: %s" % "".join(stmt))
+ print("SMT Solver terminated unexpectedly: %s" % "".join(stmt), flush=True)
sys.exit(1)
stmt = "".join(stmt)
if stmt.startswith("(error"):
- print("SMT Solver Error: %s" % stmt, file=sys.stderr)
+ print("SMT Solver Error: %s" % stmt, file=sys.stderr, flush=True)
+ if self.solver != "dummy":
+ self.p_close()
sys.exit(1)
return stmt