Skip to content
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

Z3 overrides signal handlers #115

Closed
filipeom opened this issue May 26, 2024 · 2 comments
Closed

Z3 overrides signal handlers #115

filipeom opened this issue May 26, 2024 · 2 comments

Comments

@filipeom
Copy link
Member

When solving, signals raised in ocaml are typically ignored.

Code that creates signals:

let run_with_timeout limit f =
  let set_timer limit =
    ignore
    @@ Unix.setitimer Unix.ITIMER_REAL
         Unix.{ it_value = limit; it_interval = 0.01 }
  in
  let unset () =
    ignore
    @@ Unix.setitimer Unix.ITIMER_REAL Unix.{ it_value = 0.; it_interval = 0. }
  in
  set_timer limit;
  Sys.set_signal Sys.sigalrm (Sys.Signal_handle (fun _ -> raise Out_of_time));
  let f () = try `Ok (f ()) with Out_of_time -> `Timeout in
  Fun.protect f ~finally:unset
@filipeom filipeom added the bug label May 26, 2024
@filipeom filipeom closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2025
@zapashcanon
Copy link
Collaborator

Is this introduced by the Z3 ocaml bindings or by Z3 itself?

@filipeom
Copy link
Member Author

filipeom commented Feb 8, 2025

It seems to be by Z3 itself. I had similar issues with the Z3 binary as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants