fix(tests): copy the runner, not /bin/cat, as the POSIX blocked image - #1921
Open
OhOkThisIsFine wants to merge 1 commit into
Open
fix(tests): copy the runner, not /bin/cat, as the POSIX blocked image#1921OhOkThisIsFine wants to merge 1 commit into
OhOkThisIsFine wants to merge 1 commit into
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 <noreply@anthropic.com> Signed-off-by: OhOkThisIsFine <102485413+OhOkThisIsFine@users.noreply.github.com>
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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