uutils / uutils/coreutils

timeout: TERM signal sent to timeout process is not propagated to child if timeout value is 0

Open
#10,234 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - timeout
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.