Skip to content

dune hangs in mdx tests waiting for _build/default/_build/.rpc/dune #12900

@talex5

Description

@talex5

I noticed that the capnp-rpc-unix package's tests now hang with the latest dune, whereas they used to pass (ocaml/opam-repository#29035 (comment)).

Reproduction

I simplified it, and trying to test this file results in a hang:

<!-- $MDX dir=example -->
```sh
$ dune exec -- ./main.exe run-server &
$ dune exec -- ./main.exe run-client
```

My dummy example/main.ml is:

let () =
  if Sys.argv.(1) = "run-server" then Unix.sleep 10
  else print_endline "hi"

dune test hangs and strace shows a dune exec -- ./main.exe run-client process doing this endlessly:

newfstatat(AT_FDCWD, "_build/.rpc/dune", 0x7ffc014ef1f0, 0) = -1 ENOENT (No such file or directory)
futex(0x562c57544710, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 258, NULL, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x562c5751f110, FUTEX_WAKE_PRIVATE, 1) = 0
newfstatat(AT_FDCWD, "_build/.rpc/dune", 0x7ffc014ef1f0, 0) = -1 ENOENT (No such file or directory)
futex(0x562c57544714, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 259, NULL, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x562c5751f110, FUTEX_WAKE_PRIVATE, 1) = 0

I suppose running the first command in the background is confusing things somehow. Is this expected to work?

Specifications

  • Version of dune (output of dune --version): 3.20.2
  • Version of ocaml (output of ocamlc --version): 5.4.0
  • Operating system (distribution and version): Debian/13.2

Additional information

I also noticed that the nested log file has some mysterious null bytes:

# Workspace root: /home/user/work/mirage/capnp-rpc/_build/default
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@# Dune context:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions