We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
headius
Learn more about funding links in repositories.
Report abuse
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
I am using jruby 9.0.0.0.pre1 (2.2.0p0) 2015-01-21 ac0d512 OpenJDK 64-Bit Server VM 24.65-b04 on 1.7.0_65-b32 +jit [linux-amd64].
jruby 9.0.0.0.pre1 (2.2.0p0) 2015-01-21 ac0d512 OpenJDK 64-Bit Server VM 24.65-b04 on 1.7.0_65-b32 +jit [linux-amd64]
I am executing processes using Open3. Instead of receiving the expected exit status, I am instead seeing a signal raised:
jruby-head :002 > Open3.popen3('ruby', '-e', 'exit true') {|i,o,e,t| t.value} => #<Process::Status: pid 21796 signal 36> jruby-head :003 > Open3.popen3('ruby', '-e', 'exit true') {|i,o,e,t| t.value} => #<Process::Status: pid 21817 signal 57>
The signal number increases by about 22 with each execution before wrapping around at around 127.
With JRuby 1.7.18, I get the expected result:
jruby-1.7.18 :002 > Open3.popen3('ruby', '-e', 'exit true') {|i,o,e,t| t.value} => #<Process::Status: pid=18784,exited(0)>
The capture3 method fails in the same way:
capture3
jruby-head :004 > Open3.capture3('ruby', '-e', 'i=STDIN.read; print i+"o"; STDOUT.flush; STDERR.print i+"e"', :stdin_data=>"i") => ["io", "ie", #<Process::Status: pid 21839 signal 79>]
The above examples are based on code from test/mri/test_open3.rb. If I run test/mri/test_open3.rb, I get 16 test failures.
test/mri/test_open3.rb
The text was updated successfully, but these errors were encountered:
Seems specific to how open3 is doing its subprocess launching. If I use system the exit status looks right:
system
~/projects/jruby $ jruby -ropen3 -e "5.times { p Open3.popen3('ruby', '-e', 'exit true') {|i,o,e,t| t.value} }" #<Process::Status: pid 36648 signal 40> #<Process::Status: pid 36662 signal 54> #<Process::Status: pid 36676 signal 68> #<Process::Status: pid 36692 signal 84> #<Process::Status: pid 36706 signal 98> ~/projects/jruby $ jruby -ropen3 -e "5.times { system('ruby', '-e', 'exit true'); p \$? }" #<Process::Status: pid 36729 exit 0> #<Process::Status: pid 36743 exit 0> #<Process::Status: pid 36757 exit 0> #<Process::Status: pid 36771 exit 0> #<Process::Status: pid 36785 exit 0>
Sorry, something went wrong.
Problem is in Process.detach...it's not using the right value for exit code:
$ jruby -e "process = spawn('ruby', '-e', 'exit true'); thread = Process.detach(process); p thread.value" #<Process::Status: pid 37181 signal 61>
e474984
Please confirm with JRuby master. Thanks for the report...this fix made a bunch of other tests start passing too.
I can confirm that this is now fixed. Thank you @headius.
Travis CI fix:
7858f7e
- force usage of jruby-9.0.1.0 as with 9.0.0.0 Travis seems to use the pre1 version which has a known bug in popen3: jruby/jruby#2494
No branches or pull requests
I am using
jruby 9.0.0.0.pre1 (2.2.0p0) 2015-01-21 ac0d512 OpenJDK 64-Bit Server VM 24.65-b04 on 1.7.0_65-b32 +jit [linux-amd64]
.I am executing processes using Open3. Instead of receiving the expected exit status, I am instead seeing a signal raised:
The signal number increases by about 22 with each execution before wrapping around at around 127.
With JRuby 1.7.18, I get the expected result:
The
capture3
method fails in the same way:The above examples are based on code from
test/mri/test_open3.rb
. If I runtest/mri/test_open3.rb
, I get 16 test failures.The text was updated successfully, but these errors were encountered: