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")))
Afficher les réponses par date
After upgrading from 4.6.1 to 4.6.2, the problem solved. Sorry for the outdated information..
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? 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):
(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
On Mon, Nov 14, 2011 at 11:15 PM, Marc Feeley feeley@iro.umontreal.cawrote:
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
On 2011-11-14, at 8:40 PM, Meng Zhang wrote:
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
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.
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!")
What happens when you try the code below?
(with-output-to-process (list path: "sed" arguments: '("-e" "s/n/N/g") stdout-redirection: #f) (lambda () (display "nothing\n")))
Do you get the output on the screen?
Marc
On Tue, Nov 15, 2011 at 10:04 AM, Marc Feeley feeley@iro.umontreal.cawrote:
On 2011-11-14, at 8:40 PM, Meng Zhang wrote:
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
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.
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!")
What happens when you try the code below?
(with-output-to-process (list path: "sed" arguments: '("-e" "s/n/N/g") stdout-redirection: #f) (lambda () (display "nothing\n")))
Do you get the output on the screen?
Yes, it prints "NothiNg" and then fall asleep without exiting.(in 4.6.1)
Marc
FYI, call stack in 4.1 0 ##thread-check-interrupts! 1 ##thread-sleep! 2 ##process-status 3 with-output-to-process
On 2011-11-14, at 9:15 PM, Meng Zhang wrote:
What happens when you try the code below?
(with-output-to-process (list path: "sed" arguments: '("-e" "s/n/N/g") stdout-redirection: #f) (lambda () (display "nothing\n")))
Do you get the output on the screen? Yes, it prints "NothiNg" and then fall asleep without exiting.(in 4.6.1)
OK. That is to be expected because there was a bug in the closing of the process file descriptors which was fixed in commit ec92f752f7c05c4d1247bb15acdb47eaaec82791 in September 2011, before v4.6.2 was released.
Marc