Skip to content
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

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

Comments

Projects
None yet
7 participants
@DrTom
Copy link

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

@BanzaiMan

This comment has been minimized.

Copy link
Member

BanzaiMan commented Oct 5, 2012

@DimaSavitsky

This comment has been minimized.

Copy link

DimaSavitsky commented Mar 19, 2013

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

@DrTom

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link

styx commented Mar 20, 2013

Same here with jruby-head

@alepulver

This comment has been minimized.

Copy link

alepulver commented May 4, 2013

same here

@envygeeks

This comment has been minimized.

Copy link

envygeeks commented May 10, 2013

This just bit me in the ass today:

stdin, stdout, stderr, pid = Open3.popen3("xclip -o -selection clipboard")
# => [#<IO:0x1e271de>, #<IO:0x1a1ccbd>, #<IO:0x188cdc1>]

@ghost ghost assigned headius Sep 7, 2013

@BanzaiMan

This comment has been minimized.

Copy link
Member

BanzaiMan commented Sep 7, 2013

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

This comment has been minimized.

Copy link
Member

BanzaiMan commented Sep 7, 2013

Eh. I spoke too soon.

@BanzaiMan BanzaiMan reopened this Sep 7, 2013

@BanzaiMan

This comment has been minimized.

Copy link
Member

BanzaiMan commented Sep 7, 2013

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
You can’t perform that action at this time.