A process table dump shows, and strace'ing strace verifies, that the beast
fails to restart the parent process because it doesn't take the WNOHANG
flag into account when deciding that a parent process should be suspended
because it's waiting for children. :-( Usually, this suspension is a
Good Thing because the child processes are temporarily children of strace.
free sibling
task PC stack pid father child younger older
[...]
strace 123 S 00000000 4 29553 1765 29555 29544
foo 124 T 00000000 4 29554 29553 29555
foo 125 S 01D53EA3 396 29555 29553 29554
Here's the (rather trivial) patch:
RCS file: /usr/src/cvs/misc/strace/process.c,v
diff -u -r1.2 process.c
--- process.c 1996/07/30 07:36:06 1.2
+++ process.c 1997/02/04 06:41:27
@@ -818,7 +818,7 @@
struct tcb *tcp;
{
if (entering(tcp)) {
- if (tcp->nchildren > 0) {
+ if (!(tcp->u_arg[2] & WNOHANG) && tcp->nchildren > 0) {
/* There are traced children */
tcp->flags |= TCB_SUSPENDED;
tcp->waitpid = tcp->u_arg[0];
-- The greatest of fools is he who imposes on himself, and in greatest concern thinks certainly he knows that which he has least studied, and of which he is profoundly ignorant. -- Shaftesbury-- Matthias Urlichs \ noris network GmbH / Xlink-POP Nürnberg Schleiermacherstraße 12 \ Linux+Internet / EMail: urlichs@noris.de 90491 Nürnberg (Germany) \ Consulting+Programming+Networking+etc'ing PGP: 1024/4F578875 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE Click <A HREF="http://info.noris.de/~smurf/finger">here</A>. 42