You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jruby 9.2.7 with Java 11 is throwing "Native subprocess control requires open access to sun.nio.ch" warning #5736
jruby 9.2.7.0 (2.5.3) 2019-04-09 8a269e3 OpenJDK 64-Bit Server VM 11+28 on 11+28 +jit
Windows 10
Expected Behavior
Should not receive warning about "Native subprocess control requires open access to sun.nio.ch" since this was supposed to have been addressed in #5642 which was included in 9.2.7
Actual Behavior
Even running simple tasks from the command line I get the following warnings:
$ jruby -version
jruby 9.2.7.0 (2.5.3) 2019-04-09 8a269e3 OpenJDK 64-Bit Server VM 11+28 on 11+28 +jit [mswin32-x86_64]
2019-05-15T10:00:45.880-10:00 [main] WARN FilenoUtil : Native subprocess control requires open access to sun.nio.ch
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist' or '=org.jruby.core' to enable.
java.lang.IllegalCallerException: sun.nio.ch is not open to module org.jruby.dist
at java.base/java.lang.Module.addOpens(Module.java:763)
at org.jruby.dist/com.headius.backport9.modules.impl.Module9.addOpens(Module9.java:28)
at org.jruby.dist/com.headius.backport9.modules.Modules.addOpens(Modules.java:22)
at org.jruby.dist/org.jruby.util.io.FilenoUtil$ReflectiveAccess.(FilenoUtil.java:140)
at org.jruby.dist/org.jruby.util.io.FilenoUtil.getFilenoUsingReflection(FilenoUtil.java:111)
at org.jruby.dist/org.jruby.util.io.FilenoUtil.filenoFrom(FilenoUtil.java:107)
at org.jruby.dist/org.jruby.util.io.ChannelFD.initFileno(ChannelFD.java:42)
at org.jruby.dist/org.jruby.util.io.ChannelFD.(ChannelFD.java:32)
at org.jruby.dist/org.jruby.util.io.OpenFile.setChannel(OpenFile.java:196)
at org.jruby.dist/org.jruby.RubyIO.prepIO(RubyIO.java:261)
at org.jruby.dist/org.jruby.RubyIO.prepStdio(RubyIO.java:190)
at org.jruby.dist/org.jruby.RubyGlobal.initSTDIO(RubyGlobal.java:297)
at org.jruby.dist/org.jruby.RubyGlobal.createGlobals(RubyGlobal.java:211)
at org.jruby.dist/org.jruby.Ruby.init(Ruby.java:1260)
at org.jruby.dist/org.jruby.Ruby.newInstance(Ruby.java:370)
at org.jruby.dist/org.jruby.Main.internalRun(Main.java:273)
at org.jruby.dist/org.jruby.Main.run(Main.java:234)
at org.jruby.dist/org.jruby.Main.main(Main.java:206)
NameError: undefined local variable or method `rsion' for main:Object
changed the title [-]Jruby 9.2.7 with Java 11 is throwing "Native subprocess control requires open access to sun.nio.ch" error[/-][+]Jruby 9.2.7 with Java 11 is throwing "Native subprocess control requires open access to sun.nio.ch" warning[/+]on May 17, 2019
I'm still seeing this in Jruby 9.2.8.0. The command jruby -v has clean output as @headius posted above, but any other command (e.g. gem install bundler) gives me the warning:
WARN FilenoUtil : Native subprocess control requires open access to sun.nio.ch Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist' or '=org.jruby.core' to enable.
Reacted by Yann Bongiovanni, Daniel Azuma and Allokrv
I'm getting the same exception for the Shrine test suite. Strangely, it's only happening on Travis, locally everything passes great on JRuby 9.2.8.0.
Could it be that RVM installs JRuby differently than ruby-build (which is what I'm using locally)? Or could it be because Travis has different environment than mine? My environment is:
$ jruby --version
jruby 9.2.8.0 (2.5.3) 2019-08-12 a1ac7ff Java HotSpot(TM) 64-Bit Server VM 25.40-b25 on 1.8.0_40-b27 +jit [darwin-x86_64]
$ uname -a
Darwin Jankos-MacBook-Pro-2.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
I don't know if it's because of this issue, but my JRuby test run is not able to finish anymore on Shrine master on Travis CI (locally it finishes without problems). It seems to have been introduced by a commit which is unfortunately too large to analyze 😞
@janko Can you give it a try with JRuby master (I think jruby-head should work with rvm)? We have made improvements there that I believe may fix your case.
This only happens on Java 9 or higher; your local environment is running Java 8.
@headius My Travis configuration is running jruby-head as well, the last one ran about 4 hours ago. The test suite is running some shell commands, I suppose that triggers it.
At the moment I don't have any more information. I think I will have to install Java 9 and get the failure locally, and try to pinpoint the location where it happens.
Hmm that is strange. I do get the error with JRuby 9.2.8.0, but master is fine:
$ jruby -e nil
jruby 9.2.8.0 (2.5.3) 2019-08-12 a1ac7ff OpenJDK 64-Bit Server VM 11.0.2+9 on 11.0.2+9 +jit [darwin-x86_64]
2019-09-11T22:39:52.683+07:00 [main] WARN FilenoUtil : Native subprocess control requires open access to sun.nio.ch
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist' or '=org.jruby.core' to enable.
Don't bother with Java 9; use a recent version of Java 11. Java 9 is not an LTS release.
Activity
[-]Jruby 9.2.7 with Java 11 is throwing "Native subprocess control requires open access to sun.nio.ch" error[/-][+]Jruby 9.2.7 with Java 11 is throwing "Native subprocess control requires open access to sun.nio.ch" warning[/+]headius commentedon May 20, 2019
This is working properly for 9.2.8.0:
I believe this was fixed along with #5642.
Upgrade JRuby
PragTob commentedon Jul 28, 2019
Any news on when we can get this release? I believe we're experiencing this in simplecov right now I'll try to pin the JDK and see how that goes.
Use JDK8 to avoid JDK11 problems/failures
jessicaspeir commentedon Aug 28, 2019
I'm still seeing this in Jruby 9.2.8.0. The command
jruby -vhas clean output as @headius posted above, but any other command (e.g.gem install bundler) gives me the warning:WARN FilenoUtil : Native subprocess control requires open access to sun.nio.ch Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist' or '=org.jruby.core' to enable.janko commentedon Sep 11, 2019
I'm getting the same exception for the Shrine test suite. Strangely, it's only happening on Travis, locally everything passes great on JRuby 9.2.8.0.
Could it be that RVM installs JRuby differently than ruby-build (which is what I'm using locally)? Or could it be because Travis has different environment than mine? My environment is:
I don't know if it's because of this issue, but my JRuby test run is not able to finish anymore on Shrine
masteron Travis CI (locally it finishes without problems). It seems to have been introduced by a commit which is unfortunately too large to analyze 😞headius commentedon Sep 11, 2019
@janko Can you give it a try with JRuby master (I think jruby-head should work with rvm)? We have made improvements there that I believe may fix your case.
This only happens on Java 9 or higher; your local environment is running Java 8.
janko commentedon Sep 11, 2019
@headius My Travis configuration is running jruby-head as well, the last one ran about 4 hours ago. The test suite is running some shell commands, I suppose that triggers it.
At the moment I don't have any more information. I think I will have to install Java 9 and get the failure locally, and try to pinpoint the location where it happens.
FWIW, the two shell commands I know of are a
filecommand with stdin, and MiniMagick. They both useOpen3.popen3.headius commentedon Sep 11, 2019
Hmm that is strange. I do get the error with JRuby 9.2.8.0, but master is fine:
Don't bother with Java 9; use a recent version of Java 11. Java 9 is not an LTS release.
headius commentedon Sep 11, 2019
Oh I know what's up. rvm installs jruby-launcher, a native binary, which does not have the changes from JRuby master's jruby.bash script.
headius commentedon Sep 11, 2019
@janko We'll move discussion to jruby/jruby-launcher#27.
rdp commentedon Dec 30, 2022
Sure enough seems you need these params for complete.jar to be able to send signals to processes...works :)