From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Fri, 15 Dec 2006 21:12:12 -0500 From: "Russ Cox" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] wait race? In-Reply-To: <9ad68ddb26c79d699d261fdf5fbdc505@coraid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9ad68ddb26c79d699d261fdf5fbdc505@coraid.com> Topicbox-Message-UUID: f533e0a8-ead1-11e9-9d60-3106f5b1d025 > this command frequently hangs on my terminal > for(i in `{seq 1 $n}){echo fu>/dev/null&} The back trace looks like rc is still trying to run seq (it is in Xbackq, which is running the backquote expression) and has not even gotten to the interesting part. I might believe that if you ran two in a row: for(i in `{seq 1 $n}){echo fu>/dev/null&} for(i in `{seq 1 $n}){echo fu>/dev/null&} then that would make it hanging like that much more likely. But what it might have seen instead is a read returning -1 because it was interrupted by a sys: child note. So seq might not actually be done. That being said, there would still have to be a bug in the kernel (or seq), since rc has closed the pipe end that it is reading at that point, so seq shouldn't be blocked trying to write to it. If you can reproduce the "hang", can you run ps and see if the pid that rc is waiting for (it's in the argument to Waitfor in the stack trace) is still running? If so, what's that guy doing, and is it sed or is it rc? Russ