-
-
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
Process.spawn with redirect causes ConcurrencyError #3038
Comments
The :out key's array can have 1, 2, or 3 values in it. This ConcurrencyError is actually thrown because of an ArrayIndexOutOfBoundsException thrown at https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/RubyArray.java#L4398. That gets called via https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/util/io/PopenExecutor.java#L1537. It looks like the code here and on line 1528 of PopenExecutor assumes that requesting an array index past the end of the array will return nil. But, what's happening instead is this ConcurrencyError gets thrown. The code needs to either check array length before accessing elements or use another method besides |
@bbrowning Ahh nice investigation. Simple enough to fix; I'm sure this was a flaw in my port, where I used a different method from MRI (i.e. one that errors rather than returning nil). |
I added a spec for this behavior, but it appears JRuby is having trouble running these redirecting specs within RubySpec. We'll have to address that separately, but the reported spawn form should be working properly now. |
Excellent, thank you! |
Closes [#241]. Redirects `STDERR` to `STDOUT` via the `STDOUT` file descriptor (as described in the [`Kernel#spawn`][spawn] documentation). Related to [jruby/jruby#3038]. Covered by [ruby/rubyspec]. [#241]: #241 [spawn]: http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-spawn [jruby/jruby#3038]: jruby/jruby#3038 [ruby/rubyspec]: https://github.com/ruby/rubyspec/blob/bfc40c3d73cc822e436b69b20967cf9b0eb7a4d8/shared/process/spawn.rb#L363-L369
Closes [#241]. Redirects `STDERR` to `STDOUT` via the `STDOUT` file descriptor (as described in the [`Kernel#spawn`][spawn] documentation). Related to [jruby/jruby#3038]. Covered by [ruby/rubyspec]. [#241]: #241 [spawn]: http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-spawn [jruby/jruby#3038]: jruby/jruby#3038 [ruby/rubyspec]: https://github.com/ruby/rubyspec/blob/bfc40c3d73cc822e436b69b20967cf9b0eb7a4d8/shared/process/spawn.rb#L363-L369
Closes [#241]. No longer redirects `STDERR` to `STDOUT` via the `STDOUT` file descriptor (as described in the [`Kernel#spawn`][spawn] documentation). Related to [jruby/jruby#3038]. Uses `poltergeist` instead of `capybara-webkit`. Unfortunately, testing for `jruby` support is impossible until [thoughtbot/capybara-webkit#725][#725] is resolved. [#241]: #241 [spawn]: http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-spawn [jruby/jruby#3038]: jruby/jruby#3038 [#725]: thoughtbot/capybara-webkit#725
Closes [#241]. No longer redirects `STDERR` to `STDOUT` via the `STDOUT` file descriptor (as described in the [`Kernel#spawn`][spawn] documentation). Related to [jruby/jruby#3038]. Uses `poltergeist` instead of `capybara-webkit`. Unfortunately, testing for `jruby` support is impossible until [thoughtbot/capybara-webkit#725][#725] is resolved. [#241]: #241 [spawn]: http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-spawn [jruby/jruby#3038]: jruby/jruby#3038 [#725]: thoughtbot/capybara-webkit#725
jruby 9.0.0.0.rc1 (2.2.2) 2015-06-10 a0bf3b3 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
Yosemite
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
It seems JRuby does not like redirecting output on Process.spawn:
The text was updated successfully, but these errors were encountered: