Repository navigation
fix(tests): copy the runner, not /bin/cat, as the POSIX blocked image - #1921
Conversation
daemon_runtime_process_fingerprint_never_hashes_replacement_path (POSIX variant) copied /bin/cat to a temp file named "image" and executed the copy. On Ubuntu 25.10+/26.04 and any other uutils system, /bin/cat is a multi-call binary: a copy invoked under the name "image" prints "coreutils: unknown program 'image'" and exits 1, so the fixture died at ASSERT(setup). Reproduced on WSL Ubuntu 26.04 (uutils coreutils 0.8.0). The Windows variant of the same test already avoids this class of donor: it copies the test runner itself and parks it in a __cbm_runtime_image_holder argv mode. The POSIX variant now does the same. The holder mode gains a POSIX branch that blocks reading stdin until EOF — exactly the behaviour the cat donor provided — and runtime_test_spawn_blocked_executable passes the holder argument, so its target must now be a copy of this runner (it has exactly one caller). The /bin/echo replacement donor is gone too: it was only ever hashed, never executed, and on a uutils system cat and echo can be the same multi-call bytes, which would have broken the fixture's original != replacement precondition. The replacement is now a small data file, mirroring the Windows variant. No signing change is needed on macOS: the image copy stays byte-identical to the runner, and the identical-copy fixture already proves such a copy executes. daemon_runtime suite on WSL Ubuntu 26.04: 44 passed / 0 failed. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: OhOkThisIsFine <[email protected]>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Merged as This is a fix for a failure most of the project has not seen yet, which is the useful kind. Three things done right: You mirrored the Windows variant instead of inventing a mechanism. The You found the second instance of the same root cause. Removing the You addressed the platform question before it was asked. Noting that the image copy stays byte-identical to the runner, and that the identical-copy fixture already proves such a copy executes, closed the macOS-signing concern in one sentence. Reproduced with the exact failing command and output, fixed, and verified 44/0 on the affected platform. Thank you — a clean first contribution. |
Problem
daemon_runtime_process_fingerprint_never_hashes_replacement_path(POSIX variant) copies/bin/catto a temp file namedimageand executes the copy. On Ubuntu 25.10+/26.04 — and any system with uutils/Rust coreutils —/bin/catis a multi-call binary. A copy invoked under the nameimageprintscoreutils: unknown program 'image'and exits 1, so the test fails atASSERT(setup).Reproduced on WSL Ubuntu 26.04 (uutils coreutils 0.8.0):
Fix
Mirror the Windows variant of the same test, which already copies the test runner and parks it in a
__cbm_runtime_image_holderargv mode:tests/test_main.c— the__cbm_runtime_image_holdermode gains a POSIX branch: block reading stdin until EOF, exactly the behaviour thecatdonor provided.tests/test_daemon_runtime.c—runtime_test_spawn_blocked_executablepasses the holder argument; its target must now be a copy of the runner (it has exactly one caller). The POSIX fixture copies the runner viaruntime_test_copy_self_imageinstead of/bin/cat./bin/echoreplacement donor is gone too. It was only hashed, never executed — and on a uutils systemcatandechocan be the same multi-call bytes, which would break the fixture'soriginal != replacementprecondition. The replacement is now a small data file, mirroring the Windows variant.No macOS signing change is needed: the image copy stays byte-identical to the runner, and the identical-copy fixture already proves such a copy executes.
Verification
scripts/test.sh --suites daemon_runtime BUILD_DIR=build/wslon WSL Ubuntu 26.04 (uutils coreutils 0.8.0): 44 passed / 0 failed, includingdaemon_runtime_process_fingerprint_never_hashes_replacement_path.🤖 Generated with Claude Code