https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197608
Bug ID: 197608
Summary: timeout(1) does not handle zombie grandchildren
Product: Base System
Version: 11.0-CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
Created attachment 152953
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=152953&action=edit
zombie demonstration
Attached is a zombie demonstration - it forks and the child immediately exits.
The parent sleeps for one second and does not wait() for the child's status. As
expected it terminates after 1 second:
joule% /usr/bin/time ./a.out
1.02 real 0.00 user 0.00 sys
However, running under timeout(1) results in waiting for the timeout period to
expire:
joule% /usr/bin/time /timeout 10s ./a.out
10.02 real 0.00 user 0.00 sys
It looks like the issue is that we collect only one child status (cpid =
wait(&status)), which happens to be the zombie from a.out (cpid != pid). We
then loop to sigsuspend() and get stuck until the timeout expires.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"