timeout: TERM signal sent to timeout process is not propagated to child if timeout value is 0
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
If the timeout value is 0 then the TERM signal sent to timeout process is not propagated to the child process.
Test:
$ timeout -v 0 sleep 100
$ pkill -TERM timeout
It seems wait_or_timeout() ignores signals received by the timeout process if duration is 0.
This behavior is in contrast to the timeout behavior from the GNU coreutils.
As a workaround a very large timeout value could be used.
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 locating the timeout implementation and inspect wait_or_timeout(), which the issue identifies as ignoring signals when the duration is 0. Reproduce the behavior with timeout -v 0 sleep 100 and pkill -TERM timeout, then compare the result with GNU coreutils. Done means TERM reaches the child for a zero timeout, with regression coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100