Skip to content

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

Closed

Description

@twkatadin

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

Activity

  1. 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
  2. headius commented on May 20, 2019

    @headius
    Member

    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.

  3. added this to the JRuby 9.2.8.0 milestone on May 20, 2019
  4. added a commit that references this issue on Jul 27, 2019
  5. PragTob commented on Jul 28, 2019

    @PragTob

    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.

  6. jessicaspeir commented on Aug 28, 2019

    @jessicaspeir

    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.

  7. janko commented on Sep 11, 2019

    @janko

    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 😞

  8. headius commented on Sep 11, 2019

    @headius
    Member

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

  9. janko commented on Sep 11, 2019

    @janko

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

  10. headius commented on Sep 11, 2019

    @headius
    Member

    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.

  11. headius commented on Sep 11, 2019

    @headius
    Member

    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.

  12. headius commented on Sep 11, 2019

    @headius
    Member

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

  13. rdp commented on Dec 30, 2022

    @rdp
    Contributor

    Sure enough seems you need these params for complete.jar to be able to send signals to processes...works :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions