Skip to content

tests/cut: ignore stdin write error on fast-exit delimiter test#11782

Merged
cakebaker merged 1 commit intouutils:mainfrom
sylvestre:cut-inter
Apr 13, 2026
Merged

tests/cut: ignore stdin write error on fast-exit delimiter test#11782
cakebaker merged 1 commit intouutils:mainfrom
sylvestre:cut-inter

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

test_single_quote_pair_as_delimiter_is_invalid is intermittent on i686: the parent writes "a''b\n" to cut's stdin while cut validates args and exits immediately with "delimiter must be a single character". On a fast child exit, the kernel closes the pipe read-end before the parent's write() runs, so write() returns EPIPE and the pipe_in thread panics.

The race is inherent: draining stdin in cut before exiting on an arg error would hang on terminals and read unbounded data from long pipes, contradicting GNU behavior. Use the test framework's ignore_stdin_write_error() flag, which exists for exactly this "parent writes to child that exits fast" pattern.

test_single_quote_pair_as_delimiter_is_invalid is intermittent on
i686: the parent writes "a''b\n" to cut's stdin while cut validates
args and exits immediately with "delimiter must be a single
character". On a fast child exit, the kernel closes the pipe
read-end before the parent's write() runs, so write() returns
EPIPE and the pipe_in thread panics.

The race is inherent: draining stdin in cut before exiting on an
arg error would hang on terminals and read unbounded data from
long pipes, contradicting GNU behavior. Use the test framework's
ignore_stdin_write_error() flag, which exists for exactly this
"parent writes to child that exits fast" pattern.
@sylvestre
Copy link
Copy Markdown
Contributor Author

@sylvestre sylvestre marked this pull request as ready for review April 12, 2026 20:45
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/dd/no-allocate is now passing!
Congrats! The gnu test tests/printf/printf-surprise is now passing!

@cakebaker cakebaker merged commit 4fa689a into uutils:main Apr 13, 2026
167 checks passed
@sylvestre sylvestre deleted the cut-inter branch April 13, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants