#5240·libuv

OpenBSD: uv_spawn does not report exec failures; children exit 127

Author: neilpangCreated Aug 26, 2026Updated Sep 10, 2026
  • Platform: OpenBSD 7.9 amd64
  • Libuv version: v1.x tip f87c8e4

The library builds cleanly, but a large block of the spawn and ipc tests fails. Three of them, run one at a time as a non-root user:

not ok 1 - spawn_stdout
# Output from process `spawn_stdout`:
# exit_cb
# Assertion failed in ../test/test-spawn.c on line 71:
#   `1 == exit_status` (1 == 127)

not ok 1 - spawn_fails
# Assertion failed in ../test/test-spawn.c on line 194:
#   r == UV_ENOENT || r == UV_EACCES

not ok 1 - spawn_exercise_sigchld_issue
# Assertion failed in ../test/test-spawn.c on line 2135:
#   `r == UV_EACCES` (0 == -13)

Those three point the same way. spawn_fails and spawn_exercise_sigchld_issue call uv_spawn on something that cannot be executed and expect ENOENT or EACCES; uv_spawn returns 0 instead. spawn_stdout does spawn something valid, and the child comes back with exit status 127.

So the reading I would offer, without having found the cause: on OpenBSD the child's exec failure is not making it back to the parent through the error pipe, so uv_spawn reports success and the failure turns up later as an exit status. Everything downstream that waits on a spawned helper -- the ipc tests, stdio_over_pipes, kill, process_title_big_argv -- then fails the same way, with exit_status 127.

Whole suite, gmake check as a non-root user:

OpenBSD 7.9     434 ok, 38 not ok, 20 skip
NetBSD 11.0     463 ok,  9 not ok, 13 skip
FreeBSD 15.1    444 ok, 28 not ok, 12 skip   (25 of them are #5134)

I tried twice to blame my own setup and could not:

  • moving the build tree out of /root into the test user's own home changed nothing: 39 vs 38, the one difference being a flaky signal_multiple_loops;
  • building with CMake instead of autotools, so the tests run from a real binary rather than the libtool wrapper script, made it worse rather than better: 424 ok, 48 not ok.

Controls for the single-test runs above: platform_output exits 0, and an invented test name exits 255, so the runner is discriminating.

Build steps, for reproduction:

bash
pkg_add -I autoconf%2.72 automake%1.18 libtool gmake
export AUTOCONF_VERSION=2.72 AUTOMAKE_VERSION=1.18
./autogen.sh && mkdir build && cd build && ../configure && gmake

Happy to dig further if it would help -- I have the VM and can test patches.