Subject: Re: bin/31532: nbmake loses track of its children?
To: None <,,>
From: David Laight <>
List: netbsd-bugs
Date: 09/22/2006 18:20:02
The following reply was made to PR bin/31532; it has been noted by GNATS.

From: David Laight <>
Subject: Re: bin/31532: nbmake loses track of its children?
Date: Fri, 22 Sep 2006 19:12:56 +0100

 On Sun, Oct 09, 2005 at 05:29:00PM +0000, Chuck Silvers wrote:
 > >Number:         31532
 > >Category:       bin
 > >Synopsis:       nbmake loses track of its children?
 Ok, I know what happens and why.
 The 'offending' stuff is in src/distrib/sets/sets.subr where we have
 the construct:
 ${MAKE} -B -f- all <<EOMAKE
 The shell has to create a pipe, and fork a child to write the 'here
 document' into the command, it then exec's make.
 Make is thus started with an existing child - of which it cannot
 (easily) determine the pid.
 When that child exits make expects it to be one of the children it
 forked - so outputs the message.
 Everything carries on because nothing is actually wrong!
 Possible solutions:
 1) Remove the message from make.
 2) Have make call wait3(-1, NULL, WNOHANG) on entry to determine if it
    already has children, and skip the message if there are any.
 3) Have the shell create the processes the other way around, and have the
    one that writes into the pipe wait for the real progran to exit and
    then exit with the same status.
 4) Change the build scripts so they don't (keep on) running make to find
    the values of variables.
 David Laight: