The nested-overflow test waits for the outer break to be on top instead of sleeping, and names a session that dies
This commit is contained in:
parent
8bb2885e63
commit
9373c43113
@ -7854,10 +7854,23 @@ let () =
|
||||
(* A runaway recursion evaluated in the break loop of a fault: the
|
||||
loop runs on a stack of its own with a guard page, so the second
|
||||
overflow is a second break, and both abort. *)
|
||||
(try
|
||||
ignore (eval_expr "(deep 0)");
|
||||
if not (stopped ()) then fail "the first overflow (%s) did not stop" shape
|
||||
else begin
|
||||
ignore (eval_expr "(deep 0)");
|
||||
(* How many restarts the stopped break lists, which is what tells
|
||||
the inner break from the outer — both are SegFault. The inner
|
||||
one lists its own evaluation's boundary and, below it, the
|
||||
outer one's. *)
|
||||
let listed () =
|
||||
match Wire.field (request tc "(:op \"break\")") "restarts" with
|
||||
| Some { Form.v = Form.List l; _ } -> List.length l
|
||||
| _ -> -1
|
||||
in
|
||||
let inner = listed () in
|
||||
if inner < 2 then
|
||||
fail "the nested overflow (%s) listed %d restarts" shape inner;
|
||||
(match request tc "(:op \"abort\")" with
|
||||
| r when status r = "ok" -> ()
|
||||
| r -> fail "aborting a nested overflow (%s): %s" shape (said r)
|
||||
@ -7865,11 +7878,16 @@ let () =
|
||||
fail "a nested overflow (%s) ended the session: %s" shape
|
||||
(Printexc.to_string e));
|
||||
(* The inner break unwinds on the program's thread; the second
|
||||
abort is for the outer one, so it waits for that. *)
|
||||
Unix.sleepf 0.5;
|
||||
abort is for the outer one, so it waits until the break on top
|
||||
is the outer one. *)
|
||||
if not (await ~ms:30000 (fun () -> let d = listed () in d > 0 && d < inner))
|
||||
then fail "the inner overflow's break (%s) was never left" shape;
|
||||
ignore (request tc "(:op \"abort\")");
|
||||
answers "(helper)" "1" "the session after a nested overflow"
|
||||
end;
|
||||
end
|
||||
with (Wire.Closed | Unix.Unix_error _) as e ->
|
||||
fail "a nested overflow (%s) ended the session: %s" shape
|
||||
(Printexc.to_string e));
|
||||
(try
|
||||
ignore (Wire.send tc "(:op \"close\")");
|
||||
ignore (Wire.recv tc)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user