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

Different system("start ...") behavior than MRI on Windows #2385

Open
jonforums opened this issue Dec 30, 2014 · 4 comments
Open

Different system("start ...") behavior than MRI on Windows #2385

jonforums opened this issue Dec 30, 2014 · 4 comments

Comments

@jonforums
Copy link
Contributor

@jonforums jonforums commented Dec 30, 2014

This issue still exists in my jruby 1.7.18 install on win8.1 x64. This is the same issue I posted awhile ago as jira's JRUBY-5493.

The following jruby snippet waits until the launched process returns. On the same win7.1 x64 system, MRI's 32bit versions of 2.0.0p606, 2.1.5p273, and 2.2.0p1 all return immediately without waiting on the launched process to return.

jruby -Xlaunch.inproc=false -ve "system('start dxdiag.exe')"
jruby 1.7.18 (1.9.3p551) 2014-12-22 625381c on Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b18 +jit [Windows 8.1-amd64]

Original issue ML discussion: https://groups.google.com/forum/#!topic/jruby-users/ikupYqfLvq8
Original issue gist: https://gist.github.com/jonforums/811728

@headius
Copy link
Member

@headius headius commented Feb 24, 2015

So the issue is that "start" should spawn the given command in the background and return immediately, but it doesn't for us. Ok...will poke at it for a minute.

@headius
Copy link
Member

@headius headius commented Feb 24, 2015

Hmmm...I could not reproduce this at the command line... ran jruby -e "system('start dxdiag.exe')" and it exited long before I'd quit the dxdiag tool.

Can you confirm which jruby command you're running (there's a .bat and a .exe) and how you installed JRuby?

@jonforums
Copy link
Contributor Author

@jonforums jonforums commented Feb 25, 2015

Yes, "start" should invoke the given command and return immediately.

When I run jruby -e "system('start dxdiag.exe')" I get

C:\>jruby -e "system('start dxdiag.exe')"
io/console not supported; tty will not be manipulated

## the above does not return until dxdiag gui is manually closed

jruby is installed on my win8.1 x64 system from the jruby.org jruby-bin-1.7.19.tar.gz archive. The .exe is invoked, not the .bat

C:\>uru ls --verbose
 => 1719        : jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on Java HotSpot(TM) ...
                  ID: 1.7.19
                  Home: C:\Apps\rubies\jruby\bin
                  GemHome:

    200p630-x32 : ruby 2.0.0p630 (2015-01-30 revision 49450) [i386-mingw32]
                  ID: 2.0.0-p630
                  Home: C:\Apps\rubies\ruby-2.0.0\bin
                  GemHome:

    215p299-x32 : ruby 2.1.5p299 (2015-02-19 revision 49652) [i386-mingw32]
                  ID: 2.1.5-p299
                  Home: C:\Apps\rubies\ruby-2.1\bin
                  GemHome:

    220p83-x32  : ruby 2.2.0p83 (2015-02-24 revision 49720) [i386-mingw32]
                  ID: 2.2.0-p83
                  Home: C:\Apps\rubies\ruby-2.2\bin
                  GemHome:

C:\>echo %PATH%
C:\Apps\rubies\jruby\bin;_U_;C:\ProgramData\Oracle\Java\javapath;...

C:\>jruby --version
jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on Java HotSpot(TM) 64-Bit Server VM 1.8.0_31-b13 +jit [Windows 8.1-amd64]

@jonforums
Copy link
Contributor Author

@jonforums jonforums commented Feb 25, 2015

C:\>jruby -Xlaunch.inproc=false -e "system('start dxdiag.exe')"
io/console not supported; tty will not be manipulated

## Above waits until manually closing dxdiag gui, then outputs this exception, and finally
## returns to the command prompt. Setting `-Xlaunch.inproc=false` or omitting gives same
## result as my previous example...waits until dxdiag gui returns before returning

Exception: java.lang.ThreadDeath thrown from the UncaughtExceptionHandler in thread "Thread-4"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants