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

Jruby 9.2.7 with Java 11 is throwing "Native subprocess control requires open access to sun.nio.ch" warning #5736

Closed
twkatadin opened this issue May 17, 2019 · 9 comments
Milestone

Comments

@twkatadin
Copy link

@twkatadin twkatadin commented May 17, 2019

Environment

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

at -e:1
@twkatadin twkatadin 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 May 17, 2019
@headius
Copy link
Member

@headius headius commented May 20, 2019

This is working properly for 9.2.8.0:

[] ~/projects/jruby $ jruby -v
jruby 9.2.8.0-SNAPSHOT (2.5.3) 2019-05-20 d79edcd OpenJDK 64-Bit Server VM 11.0.2+9 on 11.0.2+9 +jit [darwin-x86_64]

[] ~/projects/jruby $ 

I believe this was fixed along with #5642.

Loading

@headius headius closed this May 20, 2019
@headius headius added this to the JRuby 9.2.8.0 milestone May 20, 2019
PragTob added a commit to simplecov-ruby/simplecov that referenced this issue Jul 27, 2019
@PragTob
Copy link

@PragTob PragTob commented 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.

Loading

PragTob added a commit to simplecov-ruby/simplecov that referenced this issue Jul 28, 2019
@jessicaspeir
Copy link

@jessicaspeir jessicaspeir commented Aug 28, 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.

Loading

@janko
Copy link

@janko janko commented 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:

$ 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 😞

Loading

@headius
Copy link
Member

@headius headius commented 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.

Loading

@janko
Copy link

@janko janko commented 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 file command with stdin, and MiniMagick. They both use Open3.popen3.

Loading

@headius
Copy link
Member

@headius headius commented Sep 11, 2019

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.

Loading

@headius
Copy link
Member

@headius headius commented 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.

Loading

@headius
Copy link
Member

@headius headius commented Sep 11, 2019

@janko We'll move discussion to jruby/jruby-launcher#27.

Loading

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

Successfully merging a pull request may close this issue.

None yet
5 participants