all: many utils incorrectly retries when write failed with EINTR
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
https://github.com/uutils/coreutils/issues/1275 and https://github.com/uutils/coreutils/pull/8946 introduced retry when read/write catched EINTR. But it seems unconditional retry (without sighandler) is incorrect.
https://github.com/coreutils/coreutils/issues/268#issuecomment-4529837577
For example, strace -o /dev/null -e inject=write:error=EINTR:when=2 tee should cause
tee: 'standard output': Interrupted system call (until we introduce zero-copy code path), but we don't do that.
We don't need to exactly match when=N, but we should not infinitely retry.
[Edit] read is unrelated. write should not retly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the retry changes in uutils/coreutils issue #1275 and pull request #8946, then trace the affected write paths across the utilities. Run the provided strace injection against tee and verify that write interrupted by EINTR reports the error instead of retrying indefinitely; read behavior is out of scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100