Open3.popen3 doesn't return a thread object in jruby 1.7.0-rc1 #332

Closed
DrTom opened this Issue Oct 3, 2012 · 9 comments

Projects

None yet

7 participants

@DrTom
DrTom commented Oct 3, 2012

in MRI 1.9.3-194 the fourth and last object is a Thread as specified:

Open3.popen3("ls")
=> [#<IO:fd 6>, #<IO:fd 7>, #<IO:fd 9>, #<Thread:0x007f9b3383c9c8 sleep>]

in JRuby only three IO Objects are returned

Open3.popen3("ls")
=> [#<IO:fd 8>, #<IO:fd 7>, #<IO:fd 9>]

The same is true for the block variant of popen3.

My environment:

java -version
java version "1.7.0_06"
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)

$env | grep JRU
JRUBY_OPTS=--1.9

$env | grep JAVA
JAVA_OPTS=-client

@DimaSavitsky

Is there any progress on this? streamio-ffmpeg isn't working because of this bug. Thanks for your help!

@DrTom
DrTom commented Mar 19, 2013

C.Nutter reports a fix for 1.7.1: http://jira.codehaus.org/browse/JRUBY-6409

However, I just performed a quick test: 1.7.1 and 1.7.2 will not return the thread object.
The problem persists.

@styx
styx commented Mar 20, 2013

Same here with jruby-head

@alepulver

same here

@alepulver alepulver referenced this issue in grosser/parallel_tests May 4, 2013
Merged

Initial JRuby support #208

@envygeeks

This just bit me in the ass today:

stdin, stdout, stderr, pid = Open3.popen3("xclip -o -selection clipboard")
# => [#<IO:0x1e271de>, #<IO:0x1a1ccbd>, #<IO:0x188cdc1>]
@headius headius was assigned Sep 7, 2013
@BanzaiMan
Member

Fixed on master:

irb(main):003:0> stdin, stdout, stderr, thread = Open3.popen3("sleep 5")
=> [#<IO:fd 158>, #<IO:fd 157>, #<IO:fd 159>, #<Process::WaitThread:0x13cd159 run>]
irb(main):004:0> RUBY_DESCRIPTION
=> "jruby 1.7.5.dev (1.9.3p392) 2013-09-06 294934d on Java HotSpot(TM) 64-Bit Server VM 1.7.0_25-b15 [darwin-x86_64]"
@BanzaiMan BanzaiMan closed this Sep 7, 2013
@BanzaiMan
Member

Eh. I spoke too soon.

@BanzaiMan BanzaiMan reopened this Sep 7, 2013
@BanzaiMan
Member

Heh. No, I didn't. It's the right return value.

@BanzaiMan BanzaiMan closed this Sep 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment