<p dir="auto">go version go1.4.1 linux/amd64</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="go tool pprof cpu.prof"><pre class="notranslate"><code class="notranslate">go tool pprof cpu.prof
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Entering interactive mode (type &quot;help&quot; for commands)
(pprof) top
10.29s of 10.29s total (  100%)
      flat  flat%   sum%        cum   cum%
    10.29s   100%   100%     10.29s   100%  "><pre class="notranslate"><code class="notranslate">Entering interactive mode (type "help" for commands)
(pprof) top
10.29s of 10.29s total (  100%)
      flat  flat%   sum%        cum   cum%
    10.29s   100%   100%     10.29s   100%  
</code></pre></div>
<p dir="auto">where i should have typed this</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="go tool pprof mybinary cpu.prof"><pre class="notranslate"><code class="notranslate">go tool pprof mybinary cpu.prof
</code></pre></div>
<p dir="auto">I did fail to read the help correctly so it is my own fault - but it gave me no indication i did anything wrong.<br>
ref: <a href="https://groups.google.com/forum/#!topic/Golang-Nuts/dd9QwwGdt34" rel="nofollow">https://groups.google.com/forum/#!topic/Golang-Nuts/dd9QwwGdt34</a></p>
<p dir="auto">by <strong>ryanbressler</strong>:</p>
<pre class="notranslate">When using the exec package to run a command like "echo hello" over and over
again while reading from the pipe returned by Cmd.StdoutPipe() in separate go routines a
small number of the reads (~1/1000 in my testing) will produce read |0: bad file
descriptor errors.

This does not seem to effect longer running processes (like sleep .1) suggesting that it
may have to do with process that finish quickly.  


What steps will reproduce the problem?
1. Compile and run attached code.


What is the expected output?
No Errors.


What do you see instead?
|0: bad file descriptor for some percent of the reads.


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
OS X 10.5.8


Which revision are you using?  (hg identify)
b0819469a6df (release-branch.r60) release/release.r60


Please provide any additional information below.</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/2266/0/main.go" rel="nofollow">main.go</a> (691 bytes)</li>
</ol>