Page MenuHomeFreeBSD

Fixes for timeout(1)
ClosedPublic

Authored by kib on Mon, Jun 9, 3:02 PM.
Tags
None
Referenced Files
F122543537: D50752.id.diff
Sun, Jul 6, 3:15 AM
F122493477: D50752.diff
Sat, Jul 5, 6:33 PM
F122472176: D50752.diff
Sat, Jul 5, 2:45 PM
Unknown Object (File)
Sat, Jul 5, 10:37 AM
Unknown Object (File)
Tue, Jul 1, 7:16 AM
Unknown Object (File)
Mon, Jun 30, 1:21 PM
Unknown Object (File)
Sat, Jun 28, 1:34 AM
Unknown Object (File)
Fri, Jun 27, 6:55 PM
Subscribers

Details

Summary
kern_sigsuspend: rename wchan

The existing name "pause" is not most intuitive to guess where the
process sleep.


exit1(): Ensure that SIGCHLD from reparented child is queued to reaper

We have a reaper R and child A with grandchild B. Now, suppose that B
already have exited, and that A did not waited on B. When A is exiting,
its child B is reparented to R, but its p_ksi was already queued for A.
This means that SIGCHLD is not queued to R, it is only marked as pending
in bitmap.

If other SIGCHLD is queued, we would miss a delivery of the notification
for B exiting.  Additionally, R does not see siginfo for B.

Do not even try to send SIGCHLD if the target is zombie.  Only update
the ksi state for possible consumption by the reaper.


timeout(1): silence warnings for ESRCH

It is possible for the child to become zombie and then there is nothing
to signal.


timeout(1): print errno when signalling syscalls failed


timeout(1): only start the child command after the parent is fully set up

Since the default disposition for SIGCHLD is ignore, the prematurely
exited child would cause SIGCHLD dropped.  This makes timeout(1) hang,
because REAP_STATUS reports not waited for zombie, but SIGCHLD for it
was already lost, so the main loop cannot exit returning into
sigsuspend().


timeout(1): pass full 32bit error return code from the exited child

Switch to use waitid(2) to receive siginfo_t with the complete error
code from the exited process.


timeout(1) tests: atf_fail requires a reason

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable