https://ocaml.org/docs/error-handling#stack-traces
OCAMLRUNPARAM=b ./myprogram [args]
And you will get a stack trace. Alternatively, you can call, from within the program,
let () = Printexc.record_backtrace true
dune build --instrument-with bisect_ppx
bisect_ppx
Sandboxing of cram tests deletes the .coverage
files, thus the following workaround:
BISECT_FILE=$(pwd)/bisect dune runtest --force --instrument-with bisect_ppx