-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO.popen with file mode w does not close stream and hangs on Win7 #3473
Comments
BTW just tested that this runs successfully on centos: args = ['/usr/bin/dot', '-oimage.png', '-Tpng']
input = <<EOS
digraph G {
A -> B
}
EOS
IO.popen(args, 'w') { |io|
io.write input
} |
No investigation yet. Windows does use the old logic, since we have not completed native process support under win32 yet. However, that old logic should be at least as functional as 1.7, so I'm not sure why this would have regressed yet. Ultimate solution is obviously getting full native process support on Windows, but that will take a bit more time. |
Brief investigation found that I cannot reproduce this issue on OS X by specifying |
Wow, it blocks on my OS X! This is where the main thread hangs:
Did you try with dot? Maybe there is something particular about graphviz. Tried with JRuby 9.0.5.0 I just installed via brew. My test program was: args = ['/usr/local/bin/dot', '-oimage.png', '-Tpng']
input = <<EOS
digraph G {
A -> B
}
EOS
IO.popen(args, 'w') { |io|
io.write input
}
|
It does hang for me using dot (I was using echo). |
\o/ First goal reached :) Am Montag, 14. März 2016 schrieb Charles Oliver Nutter :
|
@robertpanzer Your theory appears to be on the right track... |
Ok, so it's fixed, but I'm not sure what to do about testing. We are currently working on improving Windows test coverage, which may pick this up. We also are not running any suites with |
This issue is related and probably the reason for asciidoctor/asciidoctorj#409
I have the following test ruby script that pipes a string to a graphviz process.
(So to retest graphviz should be installed on the machine.)
I experienced the issue with JRuby 9.0.4.0, with JRuby 1.7.+ everything works fine.
If you start this script it simply hangs:
I think the reason is that JRuby thinks that the stream is already closed in https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyIO.java#L3900 and does not close the stream.
Then the following
process.waitFor()
hangs until the end of days.The text was updated successfully, but these errors were encountered: