package dscheck
Build not checkedInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=192b0c7a3d1d48ba7b9a7884a7fb5406ad8b82094ca2f7aac87d3183aee9bcd4
sha512=88587787c9e7537061ae7cb19268a86eab88bfb3a749efd7e41ef4d5423495b1bbd23185e6e13ed3486f41b8bba6a16c01320a20b77567592739cceddf175584
Description
Added to opam-repository:
README
dscheck — tool for testing concurrent OCaml programs
Experimental model checker for testing concurrent algorithms based on Dynamic Partial-Order Reduction for Model Checking Software. At the core, dscheck runs each test numerous times, exhaustively trying every single interleaving of atomic operations. User-provided assertions are run at the end of every execution.
Usage
Dscheck can be installed from opam: opam install dscheck. Sample usage on a naive counter is shown below.
module Atomic = Dscheck.TracedAtomic
(* tested implementation needs to use dscheck's atomic module *)
let test_counter () =
let counter = Atomic.make 0 in
let incr () = Atomic.set counter (Atomic.get counter + 1) in
Atomic.spawn incr;
Atomic.spawn incr;
Atomic.final (fun () -> Atomic.check (fun () -> Atomic.get counter == 2))This is a classic example of a race condition with two threads trying to increment a counter without synchronisation. When the race occurs, one of the updates is lost. dscheck finds the interleaving that leads to that:
Found assertion violation at run 12:
Process 0: start
Process 0: get 1
Process 1: start
Process 1: get 1
Process 0: set 1
Process 1: set 1
Fatal error: exception File "src/tracedAtomic.ml", line 266, characters 6-12: Assertion failedContributions
Contributions are appreciated! Please create issues/PRs to this repo.
Dependencies (4)
- oseq
- containers
-
dune
>= "2.9" -
ocaml
>= "5.0.0"
Optional Dependencies
None
Used by (5)
-
eio
>= "0.8.1" -
lockfree
>= "0.3.1" -
moonpool
>= "0.12" -
saturn
< "0.5.0" -
saturn_lockfree
< "0.5.0"
Conflicts
None
Build status
Results of building dscheck with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
This version is not in the latest run; the versions below are.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.6.0 | n/a | n/a | good | good | good |
| 0.5.0 | n/a | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure