Conversation
pixelb
reviewed
May 22, 2026
| # If tee() implementation tried to write seed to a pipe with small size, it would hang | ||
| small_pipe() { strace -o /dev/null -e inject=fcntl:error=ENOSYS "$@"; } | ||
| if small_pipe true; then | ||
| small_pipe timeout 1 yes|head -c 1 > /dev/null || fail=1 |
Member
There was a problem hiding this comment.
timeout 1 is racy. 10 would be better
strace without -f requires timeout ... strace ... not strace ... timeout ...
Also pipe exit status is tricky since it's the last command that you get the status for.
This is especially tricky with timeout(1):
$ timeout 1 sleep inf | true; echo $?
0
I'll see can I come up with a valid test
Contributor
Author
There was a problem hiding this comment.
timeout 1 sh -c "yes|head -c 1PB"
Contributor
Author
There was a problem hiding this comment.
No. I added splice to uutils/head -c. Replaced by head -n.
oech3
force-pushed
the
patch-4
branch
3 times, most recently
from
May 22, 2026 10:58
58821c4 to
6a76e08
Compare
* tests/misc/yes.sh: Add test case with fcntl failure
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.
This is realistic bug. Please add this. #253 (comment)