Re: tcsh being dodgy, or pipe code ishoos?

From: John-Mark Gurney <gurney_j_at_efn.org>
Date: Tue, 24 Jun 2003 23:04:50 -0700
Juli Mallett wrote this message on Wed, Jun 25, 2003 at 00:15 -0500:
> * Juli Mallett <jmallett_at_FreeBSD.org> [ Date: 2003-06-24 ]
> 	[ w.r.t. Re: tcsh being dodgy, or pipe code ishoos? ]
> > * Tim Kientzle <kientzle_at_acm.org> [ Date: 2003-06-24 ]
> > > Hmmm... This looks like xargs isn't waiting for the subcommand
> > > to exit.  This looks like 'echo -- + 2' and 'echo -- + 3' are
> > > running concurrently.
> > 
> > How about this, it essentially says that in the not -P case, no procs
> > may be unwaited-on, whereas otherwise we say that 1 may be unwaited-on..
> 
> jmg_at_ points out this better idea, of doing the waitchildren before the
> vfork, allowing xargs to do its work while the child runs, as seems to
> be the desirable effect of having maxprocs=1, so.

Ok, I seem to have found out that we are reaping a child that we don't
know about.  slightly modified xargs produces this:
> ( ( echo 2 ; echo 3 ) | ktrace -id -f /tmp/xargs.ktrace ./xargs -I% echo + % ) 
waiting: waitall: 0, curprocs: 0, maxprocs: 1
reaping: pid: 1073, self: 1072, status: 0
starting
started: 1074
+waiting: waitall: 0, curprocs: 0, maxprocs: 1
 2starting

started: 1075
+ waiting: waitall: 1, curprocs: 1, maxprocs: 1
3
reaping: pid: 1074, self: 1072, status: 0
reaping: pid: 1075, self: 1072, status: 0

Examining the output shows no restiges of pid 1073.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."
Received on Tue Jun 24 2003 - 21:04:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:13 UTC