Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46725

[JDK9] Detach JNR-Posix from core

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      Jenkins 2.144

      Description

      While exploring Jenkins 2.60.3 on Oracle Java 9 build 181 (pre-release), it reports illegal access exceptions and warns that a future release of Java 9 will forbid illegal access. These uses do not seem to be able to be removed or fixed easily in JNR Posix, but Jenkins core does not use JNR Posix by default for anything critical after the changes for JENKINS-36088, so it can be detached.

      We would have to remove the useNativeChmodAndMode option, but that was only added in case of significant regressions with the NIO implementations, but I am not aware of regressions and would be fine with removing the option.

      A stack trace shows:

      WARNING: Illegal reflective access by jnr.posix.JavaLibCHelper (file:/var/jenkins_home/war/WEB-INF/lib/jnr-posix-3.0.1.jar) to method sun.nio.ch.SelChImpl.getFD()
              at jnr.posix.JavaLibCHelper.<clinit>(JavaLibCHelper.java:87)
              at jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:38)
              at jnr.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:20)
              at jnr.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:95)
              at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:69)
              at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:38)
              at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:33)
              at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:29)
              at jnr.posix.LazyPOSIX.chmod(LazyPOSIX.java:55)
              at hudson.FilePath._chmod(FilePath.java:1611)
              at hudson.FilePath.access$1500(FilePath.java:197)
              at hudson.FilePath$29.invoke(FilePath.java:1596)
              at hudson.FilePath$29.invoke(FilePath.java:1592)
              at hudson.FilePath.act(FilePath.java:998)
              at hudson.FilePath.act(FilePath.java:976)
              at hudson.FilePath.chmod(FilePath.java:1592)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.makeReadOnly(InstanceIdentity.java:116)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.write(InstanceIdentity.java:105)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:66)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:40)
              at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl.<init>(PageDecoratorImpl.java:22)
              at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl$$FastClassByGuice$$68618106.newInstance(<generated>)
              at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
              at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
              at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
              at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
              at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
              at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
      

      A different stack trace shows:

      WARNING: Illegal reflective access by jnr.posix.JavaLibCHelper (file:/var/jenkins_home/war/WEB-INF/lib/jnr-posix-3.0.1.jar) to field sun.nio.ch.FileChannelImpl.fd
              at jnr.posix.JavaLibCHelper.<clinit>(JavaLibCHelper.java:104)
              at jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:38)
              at jnr.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:20)
              at jnr.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:95)
              at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:69)
              at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:38)
              at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:33)
              at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:29)
              at jnr.posix.LazyPOSIX.chmod(LazyPOSIX.java:55)
              at hudson.FilePath._chmod(FilePath.java:1611)
              at hudson.FilePath.access$1500(FilePath.java:197)
              at hudson.FilePath$29.invoke(FilePath.java:1596)
              at hudson.FilePath$29.invoke(FilePath.java:1592)
              at hudson.FilePath.act(FilePath.java:998)
              at hudson.FilePath.act(FilePath.java:976)
              at hudson.FilePath.chmod(FilePath.java:1592)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.makeReadOnly(InstanceIdentity.java:116)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.write(InstanceIdentity.java:105)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:66)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:40)
              at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl.<init>(PageDecoratorImpl.java:22)
              at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl$$FastClassByGuice$$68618106.newInstance(<generated>)
              at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
              at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
              at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
              at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
              at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
              at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
      

      A third stack trace shows:

      WARNING: Illegal reflective access by jnr.posix.JavaLibCHelper (file:/var/jenkins_home/war/WEB-INF/lib/jnr-posix-3.0.1.jar) to field java.io.FileDescriptor.fd
              at jnr.posix.JavaLibCHelper.<clinit>(JavaLibCHelper.java:118)
              at jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:38)
              at jnr.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:20)
              at jnr.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:95)
              at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:69)
              at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:38)
              at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:33)
              at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:29)
              at jnr.posix.LazyPOSIX.chmod(LazyPOSIX.java:55)
              at hudson.FilePath._chmod(FilePath.java:1611)
              at hudson.FilePath.access$1500(FilePath.java:197)
              at hudson.FilePath$29.invoke(FilePath.java:1596)
              at hudson.FilePath$29.invoke(FilePath.java:1592)
              at hudson.FilePath.act(FilePath.java:998)
              at hudson.FilePath.act(FilePath.java:976)
              at hudson.FilePath.chmod(FilePath.java:1592)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.makeReadOnly(InstanceIdentity.java:116)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.write(InstanceIdentity.java:105)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:66)
              at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:40)
              at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl.<init>(PageDecoratorImpl.java:22)
              at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl$$FastClassByGuice$$68618106.newInstance(<generated>)
              at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
              at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
              at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
              at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
              at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
              at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
      

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Needs retesting on Java 10

            Show
            oleg_nenashev Oleg Nenashev added a comment - Needs retesting on Java 10
            Hide
            dnusbaum Devin Nusbaum added a comment -

            Some of these may be fixed in recent releases, for example see https://github.com/jnr/jnr-posix/issues/108, but we will want need to do some testing.

            Show
            dnusbaum Devin Nusbaum added a comment - Some of these may be fixed in recent releases, for example see https://github.com/jnr/jnr-posix/issues/108 , but we will want need to do some testing.
            Show
            ndeloof Nicolas De Loof added a comment - see also https://github.com/jnr/jnr-posix/issues/110
            Hide
            ndeloof Nicolas De Loof added a comment -

            sounds to me we don't have other option than deprecate hudson.Util#NATIVE_CHMOD_MODE

             

             

            Show
            ndeloof Nicolas De Loof added a comment - sounds to me we don't have other option than deprecate hudson.Util#NATIVE_CHMOD_MODE    
            Hide
            dnusbaum Devin Nusbaum added a comment -

            Yes, hudson.Util#NATIVE_CHMOD_MODE should be able to be removed. It was added to Jenkins 2.93 as part of JENKINS-36088 to help remove unnecessary usages of native code. There was a small compatibility concern with the Java vs native implementations so I defaulted to the Java impl and added a system property to enable the native implementation, but I have not seen any reports from users that needed to enable the native implementation so I do not anticipate any issues with removing the option.

            Show
            dnusbaum Devin Nusbaum added a comment - Yes, hudson.Util#NATIVE_CHMOD_MODE should be able to be removed. It was added to Jenkins 2.93 as part of  JENKINS-36088 to help remove unnecessary usages of native code. There was a small compatibility concern with the Java vs native implementations so I defaulted to the Java impl and added a system property to enable the native implementation, but I have not seen any reports from users that needed to enable the native implementation so I do not anticipate any issues with removing the option.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I am fine with removal, but I propose to recategorize the ticket to detaching JNR to a plugin so that we stay compatible

            Show
            oleg_nenashev Oleg Nenashev added a comment - I am fine with removal, but I propose to recategorize the ticket to detaching JNR to a plugin so that we stay compatible
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Released in Jenkins 2.144

            Show
            oleg_nenashev Oleg Nenashev added a comment - Released in Jenkins 2.144
            Hide
            dnusbaum Devin Nusbaum added a comment -

            Oleg Nenashev Even though we updated to the latest version of JNR to fix some warnings at startup, I think we still want to detach this at some point, so maybe it makes sense to leave the ticket open?

            Show
            dnusbaum Devin Nusbaum added a comment - Oleg Nenashev Even though we updated to the latest version of JNR to fix some warnings at startup, I think we still want to detach this at some point, so maybe it makes sense to leave the ticket open?

              People

              • Assignee:
                ndeloof Nicolas De Loof
                Reporter:
                markewaite Mark Waite
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: