Skip to content

A repro case for a bug found by model-testing Chamelon #21

@gasche

Description

@gasche

@Armael and I looked at model-based testing for Chamelon during the Mirage retreat, and we found what looks like a bug (full self-contained file at the end):

let () = Lwt_main.run @@
  let* empty = empty () in
(* @02 *) let x1 = empty in
(* @03 *) let* () =
            set x1 ([ 0; 0 ], 2) (String.make 67 ' ') in
(* @04 *) let* () =
            set x1 ([ 0; 0 ], 0) (String.make 126 ' ') in
(* @05 *) let* () =
            set x1 ([ 0; 0 ], 0) "\001" in
(* @07 *) let* () =
            set x1 ([ 0; 0 ], 0) "\000" in
(* @09 *) let* (Some observed) = get x1 ([ 0; 0 ], 0) in
          Printf.printf "%S\n%!" observed;
          assert (String.equal observed "\000");
          Lwt.return ()
          (* candidate finds "\001" *)

The sizes of the writes on instructions @03 and @04 matter, using 66 or 126 makes the bug go away.

momo_repro.ml.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions