Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a7f0cc4
timeout: Fix performance regression using sigtimedwait
quantum-encoding Nov 7, 2025
da06db6
Fix signal mask inheritance preventing child processes from receiving…
quantum-encoding Nov 7, 2025
6a1b975
ran clippy
quantum-encoding Nov 7, 2025
8256284
Fix formatting for CI
quantum-encoding Nov 7, 2025
b93e974
Address Andrea's review: pass NULL to sigtimedwait instead of unused …
quantum-encoding Nov 9, 2025
20bfab0
Use kqueue on macOS for signal waiting (sigtimedwait unavailable)
quantum-encoding Nov 8, 2025
5980057
Move kqueue to uucore for architectural consistency
quantum-encoding Nov 8, 2025
fc5ce84
Add kqueue terms to spell-checker ignore lists
quantum-encoding Nov 8, 2025
f4cdc07
Add missing spell-checker ignores for signal/kqueue terms
quantum-encoding Nov 9, 2025
0e575ba
Use io::Error::other() instead of io::Error::new(ErrorKind::Other, ...)
quantum-encoding Nov 9, 2025
a0d3a30
Replace deprecated EventFlag with EvFlags
quantum-encoding Nov 9, 2025
8c11e7a
Sort imports alphabetically
quantum-encoding Nov 9, 2025
0f2e985
Fix overflow with very large timeouts on macOS
quantum-encoding Nov 9, 2025
1053369
Add FreeBSD kqueue support
quantum-encoding Nov 9, 2025
1a2b8d8
Overflow fixes - Cap timespec conversions to prevent EINVAL with huge…
quantum-encoding Nov 9, 2025
0d446eb
Cap timeout at i64::MAX to prevent timespec overflow
quantum-encoding Nov 9, 2025
d770bc7
Use libc::time_t::MAX instead of i64::MAX
quantum-encoding Nov 9, 2025
c68f9da
When parsing extremely large durations (like i64::MAX days), the conv…
quantum-encoding Nov 9, 2025
779ee29
Cap duration at time_t::MAX seconds.
quantum-encoding Nov 9, 2025
5d1098d
Check if numeric value is too large before calling parse_time to avoi…
quantum-encoding Nov 9, 2025
4abb3fa
Replace f64-based overflow check with u128 integer comparison.
quantum-encoding Nov 9, 2025
39b1c51
Account for time unit (d/h/m/s) when checking if duration will overflow
quantum-encoding Nov 9, 2025
bf4d412
Cap huge timeouts at safe value to avoid kernel EINVAL Use None (infi…
quantum-encoding Nov 9, 2025
0eb43d9
Pre-validates duration parsing to detect overflow before calling pars…
quantum-encoding Nov 9, 2025
ecf1158
The fix now uses libc::time_t::MAX
quantum-encoding Nov 9, 2025
4d48503
capping at i32::MAX/2 to be safe across all platforms
quantum-encoding Nov 9, 2025
50ea131
fixed both overflow issues. Main duration overflow & Kill-after durat…
quantum-encoding Nov 9, 2025
e8531fa
refactored the overflow protection function to be more conservative. …
quantum-encoding Nov 9, 2025
650bef0
always use parse_time::from_str first. Only if it fails AND the value…
quantum-encoding Nov 9, 2025
be95cc5
Restore working overflow protection code from before rebase
quantum-encoding Nov 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test-timeout-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test Timeout on macOS

on:
push:
branches:
- fix-timeout-performance
workflow_dispatch:

jobs:
test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable # spell-checker:ignore dtolnay

- name: Build timeout
run: cargo build --release -p uu_timeout

- name: Run timeout tests
run: cargo test --test tests test_timeout -- --nocapture # spell-checker:ignore nocapture

- name: Test overflow case directly
run: |
./target/release/timeout 9223372036854775808d sleep 0
echo "Exit code: $?"
2 changes: 1 addition & 1 deletion src/uu/timeout/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ path = "src/timeout.rs"
[dependencies]
clap = { workspace = true }
libc = { workspace = true }
nix = { workspace = true, features = ["signal"] }
nix = { workspace = true, features = ["signal", "event"] }
uucore = { workspace = true, features = ["parser", "process", "signals"] }
fluent = { workspace = true }

Expand Down
Loading
Loading