Project

General

Profile

Actions

Bug #9082

closed

popen3 hangs when stderr gets lots of output

Added by rosenfeld (Rodrigo Rosenfeld Rosas) about 11 years ago. Updated over 8 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
Backport:
[ruby-core:58176]

Description

Create this program test.rb:

STDERR.puts "some error line\n" * 10_000

Then, try this:

ruby -r open3 -e "Open3.popen3('ruby test.rb'){|i,o,e,t|i.close;o.read}"

For this particular case, if I do "e.read" before "o.read" it works. But for my real case involving the "tidy" command with lots of warnings in the stderr it will freeze even if I call "e.read". Since I don't really need this output, I'm using popen2 and redirecting stderr to /dev/null, so this is not urgent, but I thought you'd like to know about this.

Also, if you replace 10_000 with 1_000 above it also works here.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0