[gambit-list] with-output-to-process hangs in OSX

Meng Zhang wsxiaoys.lh at gmail.com
Mon Nov 14 20:40:41 EST 2011


On Mon, Nov 14, 2011 at 11:15 PM, Marc Feeley <feeley at iro.umontreal.ca>wrote:

>
> On 2011-11-14, at 9:18 AM, Meng Zhang wrote:
>
> > After upgrading from 4.6.1 to 4.6.2, the problem solved.
> > Sorry for the outdated information..
> > --
> > Meng Zhang
> > Sent with Sparrow
> > On 2011年11月14日星期一 at 下午1:39, Meng Zhang wrote:
> >
> >> When I played with blackhole's "bh install" command in osx, it stops at
> "Downloading packages".
> >> After I look into the source code, it seems the call to
> "with-output-to-process" in "untar" function causes this.
> >>
> >> Below are code I wrote to reproduce the problem
> >>
> >> (with-output-to-process
> >>   (list path: "sed"
> >>         arguments: '("-e" "s/n/N/g"))
> >>   (lambda ()
> >>     (display "nothing")))
> >>
>
> 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?

This problem happened in 4.6.1, not 4.6.2


> It is sending the text "nothing" to sed's input.  Are you expecting the
> output of sed to appear on the terminal?
>
> 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):
>
In 4.6.1, when I run the code above, the current thread sleeps
forever.(since the stack frame is at "thread-sleep!")

>
> (with-output-to-process
>  (list path: "sed"
>        arguments: '("-e" "s/n/N/g")
>         stdout-redirection: #f)
>  (lambda ()
>    (display "nothing\n")))
>
> Perhaps blackhole should also use the stdout-redirection: #f setting.
>
> Marc
>
>


-- 
Zhang Meng
School of Software Engineering, Tongji University
MP: +86 151-2103-2798
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20111115/41c2a2c7/attachment.htm>


More information about the Gambit-list mailing list