<div>
            <div>
                <span>FYI,<br>
                </span></div><div><span>call stack in 4.1<br><div>0  ##thread-check-interrupts! </div><div>1  ##thread-sleep!         </div><div>2  ##process-status        </div><div>3  with-output-to-process  </div><div><br></div></span></div><div></div><div><span>-- <br>Meng Zhang<br>Sent with <a href="http://www.sparrowmailapp.com/?sig">Sparrow</a><br></span></div><div>
                
                <p>On 2011年11月15日星期二 at 上午10:15, Meng Zhang wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><br><br><div>On Tue, Nov 15, 2011 at 10:04 AM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote type="cite"><div>
<div><br>
On 2011-11-14, at 8:40 PM, Meng Zhang wrote:<br>
<br>
> >> Below are code I wrote to reproduce the problem<br>
> >><br>
> >> (with-output-to-process<br>
> >>   (list path: "sed"<br>
> >>         arguments: '("-e" "s/n/N/g"))<br>
> >>   (lambda ()<br>
> >>     (display "nothing")))<br>
> >><br>
><br>
> Actually, I can't get your example to run without an error on v4.6.2 .  Can I ask you what you expected your code to do?<br>
> This problem happened in 4.6.1, not 4.6.2<br>
<br>
</div>I understand.  But you said that once you upgraded to v4.6.2 the problem went away.  But when I try with v4.6.2 I get the same result as v4.6.1 on the code above.  So I am wondering why there is a difference on v4.6.2.<br>

<div><br>
> It is sending the text "nothing" to sed's input.  Are you expecting the output of sed to appear on the terminal?<br>
><br>
> The procedure with-output-to-process gives to sed a *closed* file descriptor for its stdout.  This is why sed complains ("sed: stdout: Broken pipe").  If you didn't want this, you can give an stdout-redirection: #f setting and sed's stdout will be the same as the interpreter's stdout (usually the terminal):<br>

> In 4.6.1, when I run the code above, the current thread sleeps forever.(since the stack frame is at "thread-sleep!")<br>
<br>
</div>What happens when you try the code below?<br>
<div><br>
> (with-output-to-process<br>
>  (list path: "sed"<br>
>        arguments: '("-e" "s/n/N/g")<br>
>        stdout-redirection: #f)<br>
>  (lambda ()<br>
>    (display "nothing\n")))<br>
<br>
</div>Do you get the output on the screen?<br></div></blockquote><div>Yes, it prints "NothiNg" and then fall asleep without exiting.(in 4.6.1)</div><blockquote type="cite"><div>

<font color="#888888"><br>
Marc<br>
<br>
</font></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Zhang Meng<br>School of Software Engineering, Tongji University<br>MP: +86 151-2103-2798<br>
</div></div></span>
                
                
                
                
                </blockquote>
                
                <div>
                    <br>
                </div>
            </div>
        </div>