[Bug 290844] timeout / reaper: Spurious SIGARLM
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious SIGARLM"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious SIGARLM"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious SIGARLM"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious SIGARLM"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious SIGARLM"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious SIGARLM"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious SIGARLM"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious interrupt on SIGCONT"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout / reaper: Spurious interrupt on SIGCONT"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout(1)+sh(1): read -t spurious timeout on signal"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 290844] timeout(1)+sh(1): read -t spurious timeout on signal"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 06 Nov 2025 19:20:35 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290844
Bug ID: 290844
Summary: timeout / reaper: Spurious SIGARLM
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: kern
Assignee: bugs@FreeBSD.org
Reporter: bdrewery@FreeBSD.org
CC: kib@FreeBSD.org, markj@FreeBSD.org, pho@FreeBSD.org
CURRENT 55c28005f544282b984ae0e15dacd0c108d8ab12
I believe this is a problem with the reaper and not timeout(1).
shell read with timeout and SIGINFO trap. Expect it to get status 157 (SIGINFO)
only.
With timeout(1) it also gets a 142 SIGALRM which causes an early timeout.
Expected:
```
sh -c 'pread() { while :; do read -t 50 n; ret=$?; echo $ret; case $ret in
142) exit 1; esac; done; }; trap "echo info" INFO; pread; echo done'
# ^T
load: 0.17 cmd: sh 4824 [select] 0.35r 0.00u 0.01s 0% 3296k
mi_switch+0x172 sleepq_switch+0x109 sleepq_catch_signals+0x276
sleepq_timedwait_sig+0x12 _cv_timedwait_sig_sbt+0x187 kern_select+0xa93
sys_select+0x57 amd64_syscall+0x451 fast_syscall_common+0xf8
info
157 # SIGINFO
```
Actual:
```
timeout -v 100 sh -c 'pread() { while :; do read -t 50 n; ret=$?; echo $ret;
case $ret in 142) exit 1; esac; done; }; trap "echo info" INFO; pread; echo
done'
# ^T
load: 0.35 cmd: sh 5283 [select] 0.45r 0.00u 0.00s 0% 3288k
mi_switch+0x172 sleepq_switch+0x109 sleepq_catch_signals+0x276
sleepq_timedwait_sig+0x12 _cv_timedwait_sig_sbt+0x187 kern_select+0xa93
sys_select+0x57 amd64_syscall+0x451 fast_syscall_common+0xf8
info
157 # SIGINFO
timeout: received signal INFO(29)
timeout: sending signal INFO(29) to command 'sh'
timeout: signaled 1 processes
timeout: sending signal CONT(19) to command 'sh'
info
157 # SIGINFO
142 # SIGALRM ???
```
Note timeout(1) forwards the SIGINFO so it is received twice. That's "fine".
The SIGARLM isn't fine.
--
You are receiving this mail because:
You are the assignee for the bug.