Skip to content

Commit

Permalink
Add printstats output to abnormal exit as well
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Feb 28, 2022
1 parent 9104791 commit e75edab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/goblint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ let main () =
if !verified = Some false then exit 3) (* verifier failed! *)
with
| Exit ->
do_stats ();
exit 1
| Sys.Break -> (* raised on Ctrl-C if `Sys.catch_break true` *)
do_stats ();
(* Printexc.print_backtrace BatInnerIO.stderr *)
eprintf "%s\n" (MessageUtil.colorize ~fd:Unix.stderr ("{RED}Analysis was aborted by SIGINT (Ctrl-C)!"));
exit 131 (* same exit code as without `Sys.catch_break true`, otherwise 0 *)
| Timeout ->
do_stats ();
eprintf "%s\n" (MessageUtil.colorize ~fd:Unix.stderr ("{RED}Analysis was aborted because it reached the set timeout of " ^ get_string "dbg.timeout" ^ " or was signalled SIGPROF!"));
exit 124

Expand Down

0 comments on commit e75edab

Please sign in to comment.