You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop catching async exceptions in hacks that catch anomalies
Typically the reductionops "Tried to normalize ill-typed term" hack
deliberately catches anomalies (including those from CErrors.anomaly)
but shouldn't catch async exceptions.
Hopefully fixes the non working Fail Timeout in bedrock2, we could
also revert #21216 for our own test suite.
(debugging tip: apply
~~~diff
@@ -32,7 +32,14 @@ let check_for_interrupt () =
(* This function assumes it is the only function calling [setitimer] *)
let unix_timeout n f x =
let open Unix in
- let timeout_handler _ = raise Timeout in
+ let timeout_handler _ =
+ let info = Exninfo.reify () in
+ let () =
+ Exninfo.get_backtrace info |> Option.iter @@ fun bt ->
+ Printf.eprintf "timeout at %s\n%!" (Exninfo.backtrace_to_string bt)
+ in
+ raise Timeout
+ in
let old_timer = getitimer ITIMER_REAL in
(* Here we assume that the existing timer will also interrupt us. *)
if old_timer.it_value > 0. && old_timer.it_value <= n then Ok (f x) else
~~~
then run a buggy Timeout with `Set Debug "backtrace"` on until you get
the bug, the function which catches the timeout exn should be in the
printed backtrace. For instance I had
~~~
Called from Reductionops.infer_conv_gen in file "pretyping/reductionops.ml", line 1324, characters 10-52
~~~
when trying the Fail Timeout in bedrock2 LeakageSemantics.)
0 commit comments