-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Environment
Provide at least:
- JRuby version (
jruby -v) and command line (flags, JRUBY_OPTS, etc):andjruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 Java HotSpot(TM) 64-Bit Server VM 9.0.4+11 on 9.0.4+11 +jit [darwin-x86_64]jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 Java HotSpot(TM) 64-Bit Server VM 11.0.1+13-LTS on 11.0.1+13-LTS +jit [darwin-x86_64] - Operating system and platform (e.g.
uname -a):Darwin castrovel.local 16.7.0 Darwin Kernel Version 16.7.0: Sun Oct 28 22:30:19 PDT 2018; root:xnu-3789.73.27~1/RELEASE_X86_64 x86_64
Other relevant info you may wish to add:
- Installed or activated gems: N/A
- Application/framework version (e.g. Rails, Sinatra): N/A
- Environment variables: N/A
Expected Behavior
- When
Open::capture2()(and friends) is givenstdin_data: 'hello, world', the supplied string should be provided as stdin to the shelled out command
#!/usr/bin/env ruby require 'open3' $stderr.puts(RUBY_DESCRIPTION) capture, status = Open3.capture2('cat', stdin_data: 'hello, world') $stdout.puts(capture: capture, status: status)--
cat.rb
With Java 8:
╭─{ yaauie@castrovel:~/src/yaauie/jruby-vs-java-11 } ╰─○ JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" ruby cat.rb jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 Java HotSpot(TM) 64-Bit Server VM 25.152-b16 on 1.8.0_152-b16 +jit [darwin-x86_64] {:capture=>"hello, world", :status=>#<Process::Status: pid 18214 exit 0>} [success]
Actual Behavior
With Java 9+
╭─{ yaauie@castrovel:~/src/yaauie/jruby-vs-java-11 } ╰─○ JAVA_HOME="$(/usr/libexec/java_home -v 9)" ruby cat.rb jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 Java HotSpot(TM) 64-Bit Server VM 9.0.4+11 on 9.0.4+11 +jit [darwin-x86_64]
The command hangs at this point; when it is sent SIGINT, it resumes without having sent the string as stdin to the child process:
^C{:capture=>"", :status=>#<Process::Status: pid 18296 INT (signal 2)>} [error: 130 (15.000s)]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels