Commit 3175e9b
committed
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.)1 parent b52b14d commit 3175e9b
File tree
13 files changed
+29
-19
lines changed- checker
- dev/ci/user-overlays
- lib
- plugins/ltac
- pretyping
- stm
- tactics
- topbin
- toplevel
- vernac
13 files changed
+29
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
| 441 | + | |
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
451 | | - | |
| 451 | + | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1868 | 1868 | | |
1869 | 1869 | | |
1870 | 1870 | | |
1871 | | - | |
| 1871 | + | |
1872 | 1872 | | |
1873 | 1873 | | |
1874 | 1874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1143 | 1143 | | |
1144 | 1144 | | |
1145 | 1145 | | |
1146 | | - | |
| 1146 | + | |
| 1147 | + | |
1147 | 1148 | | |
1148 | 1149 | | |
1149 | 1150 | | |
1150 | 1151 | | |
1151 | 1152 | | |
1152 | 1153 | | |
1153 | 1154 | | |
1154 | | - | |
| 1155 | + | |
| 1156 | + | |
1155 | 1157 | | |
1156 | 1158 | | |
1157 | 1159 | | |
| |||
1192 | 1194 | | |
1193 | 1195 | | |
1194 | 1196 | | |
1195 | | - | |
| 1197 | + | |
1196 | 1198 | | |
1197 | 1199 | | |
1198 | 1200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
2106 | | - | |
| 2106 | + | |
2107 | 2107 | | |
2108 | 2108 | | |
2109 | 2109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
0 commit comments