From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom To: 9fans@cse.psu.edu, Russ Cox References: <9ad68ddb26c79d699d261fdf5fbdc505@coraid.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: Subject: Re: [9fans] wait race? Message-Id: <20061216032615.C6AC1221985@medicine-bow.quanstro.net> Date: Fri, 15 Dec 2006 22:26:15 -0500 Cc: Topicbox-Message-UUID: f5393be8-ead1-11e9-9d60-3106f5b1d025 russ, you're spot-on, as per usual. obvously, debugging when tired is a dangerous thing for me. i should have noticed the things you've pointed out right away. the second or third cut-and-paste of that command sequence usually does hang rc, which DEL fixes. tomorrow, i will try to reproduce things. (it was quite reliable.) and see if i can get some more information. the return value of write /sys/src/cmd/seq,c:84 & 92 is not checked, but as you noted, that might not be the full story. - erik "Russ Cox" writes | | > 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