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

Job failure on remote node running JDK1.8 - java.lang.NoSuchMethodException: java.lang.UNIXProcess.destroyProcess(int)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When attempting to build on a remote node running linux the following exception is thrown
      Caused by: java.lang.LinkageError
      at hudson.util.ProcessTree$UnixReflection.<clinit>(ProcessTree.java:618)
      at hudson.util.ProcessTree$UnixProcess.kill(ProcessTree.java:552)
      at hudson.util.ProcessTree$UnixProcess.killRecursively(ProcessTree.java:572)
      at hudson.util.ProcessTree$Unix.killAll(ProcessTree.java:496)
      at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:899)
      at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:890)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:328)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: java.lang.NoSuchMethodException: java.lang.UNIXProcess.destroyProcess(int)
      at java.lang.Class.getDeclaredMethod(Class.java:2117)
      at hudson.util.ProcessTree$UnixReflection.<clinit>(ProcessTree.java:607)
      ... 13 more

      This seems to be due to java.lang.UNIXProcess.destroyProcess no longer existing in Java1.8

        Attachments

          Activity

          audumla Marius Gleeson created issue -
          audumla Marius Gleeson made changes -
          Field Original Value New Value
          Summary Job failure on remote node when runnign JDK1.8 - java.lang.NoSuchMethodException: java.lang.UNIXProcess.destroyProcess(int) Job failure on remote node running JDK1.8 - java.lang.NoSuchMethodException: java.lang.UNIXProcess.destroyProcess(int)
          Hide
          pliljenberg Peter Liljenberg added a comment -

          This issue also arise in (several?) plugins that are using the ProcessTree code to shut down processes, for example Xvfb plugin.
          Is there a planned date for Jenkins being able to run on Java8 (both slaves and master)?
          Release 1.557 seems to contain the fix for XStream with Java8, but this issue isn't planned for any release from what I can see?

          java.io.IOException: Remote call on jenkins-slave2 failed
              at hudson.remoting.Channel.call(Channel.java:731)
              at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:167)
              at $Proxy49.kill(Unknown Source)
              at hudson.Launcher$RemoteLauncher$ProcImpl.kill(Launcher.java:920)
              at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.shutdownAndCleanup(XvfbBuildWrapper.java:201)
              at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.access$000(XvfbBuildWrapper.java:73)
              at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper$5.tearDown(XvfbBuildWrapper.java:503)
              at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:862)
              at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:585)
              at hudson.model.Run.execute(Run.java:1676)
              at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
              at hudson.model.ResourceController.execute(ResourceController.java:88)
              at hudson.model.Executor.run(Executor.java:231)
          Caused by: java.lang.NoClassDefFoundError: Could not initialize class hudson.util.ProcessTree$UnixReflection
              at hudson.util.ProcessTree$Unix.get(ProcessTree.java:485)
              at hudson.util.ProcessTree.killAll(ProcessTree.java:147)
              at hudson.Proc$LocalProc.destroy(Proc.java:379)
              at hudson.Proc$LocalProc.kill(Proc.java:371)
              at hudson.Launcher$RemoteLaunchCallable$1.kill(Launcher.java:1015)
              at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:483)
              at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
              at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
              at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
              at hudson.remoting.UserRequest.perform(UserRequest.java:118)
              at hudson.remoting.UserRequest.perform(UserRequest.java:48)
              at hudson.remoting.Request$2.run(Request.java:328)
              at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at hudson.remoting.Engine$1$1.run(Engine.java:63)
              at java.lang.Thread.run(Thread.java:744)
          
          Show
          pliljenberg Peter Liljenberg added a comment - This issue also arise in (several?) plugins that are using the ProcessTree code to shut down processes, for example Xvfb plugin. Is there a planned date for Jenkins being able to run on Java8 (both slaves and master)? Release 1.557 seems to contain the fix for XStream with Java8, but this issue isn't planned for any release from what I can see? java.io.IOException: Remote call on jenkins-slave2 failed at hudson.remoting.Channel.call(Channel.java:731) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:167) at $Proxy49.kill(Unknown Source) at hudson.Launcher$RemoteLauncher$ProcImpl.kill(Launcher.java:920) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.shutdownAndCleanup(XvfbBuildWrapper.java:201) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.access$000(XvfbBuildWrapper.java:73) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper$5.tearDown(XvfbBuildWrapper.java:503) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:862) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:585) at hudson.model.Run.execute(Run.java:1676) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Caused by: java.lang.NoClassDefFoundError: Could not initialize class hudson.util.ProcessTree$UnixReflection at hudson.util.ProcessTree$Unix.get(ProcessTree.java:485) at hudson.util.ProcessTree.killAll(ProcessTree.java:147) at hudson.Proc$LocalProc.destroy(Proc.java:379) at hudson.Proc$LocalProc.kill(Proc.java:371) at hudson.Launcher$RemoteLaunchCallable$1.kill(Launcher.java:1015) at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang. Thread .run( Thread .java:744)
          Hide
          pliljenberg Peter Liljenberg added a comment -

          So the real issue is that the method signature changed in Java8 and that we rely heavily on reflection to actually kill the process.

                          DESTROY_PROCESS = clazz.getDeclaredMethod("destroyProcess", int.class);
          

          I submitted a small hack to at least get around this: https://github.com/jenkinsci/jenkins/pull/1169

          Show
          pliljenberg Peter Liljenberg added a comment - So the real issue is that the method signature changed in Java8 and that we rely heavily on reflection to actually kill the process. DESTROY_PROCESS = clazz.getDeclaredMethod( "destroyProcess" , int .class); I submitted a small hack to at least get around this: https://github.com/jenkinsci/jenkins/pull/1169
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/util/ProcessTree.java
          http://jenkins-ci.org/commit/jenkins/19640e7b4aa6d54865bc0816b604f4c0a9add6b6
          Log:
          [FIXED JENKINS-21341] Merge pull request #1169 from pliljenberg/master

          Ugly hack to fix destroyProcess for Java8

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/util/ProcessTree.java http://jenkins-ci.org/commit/jenkins/19640e7b4aa6d54865bc0816b604f4c0a9add6b6 Log: [FIXED JENKINS-21341] Merge pull request #1169 from pliljenberg/master Ugly hack to fix destroyProcess for Java8
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          rcgroot René de Groot added a comment -

          Where can I find in witch version this fix will be available?
          There is no mention on http://jenkins-ci.org/changelog

          I think I have the same issue with Jenkins ver. 1.559 on OS-X and java version "1.8.0".

          FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection
          java.lang.NoClassDefFoundError: Could not initialize class hudson.util.ProcessTree$UnixReflection
          at hudson.util.ProcessTree$UnixProcess.kill(ProcessTree.java:553)
          at hudson.util.ProcessTree$UnixProcess.killRecursively(ProcessTree.java:573)
          at hudson.util.ProcessTree$UnixProcess.killRecursively(ProcessTree.java:572)
          at hudson.util.ProcessTree$Unix.killAll(ProcessTree.java:497)
          at hudson.Launcher$LocalLauncher.kill(Launcher.java:798)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:546)
          at hudson.model.Run.execute(Run.java:1700)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:231)

          Show
          rcgroot René de Groot added a comment - Where can I find in witch version this fix will be available? There is no mention on http://jenkins-ci.org/changelog I think I have the same issue with Jenkins ver. 1.559 on OS-X and java version "1.8.0". FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection java.lang.NoClassDefFoundError: Could not initialize class hudson.util.ProcessTree$UnixReflection at hudson.util.ProcessTree$UnixProcess.kill(ProcessTree.java:553) at hudson.util.ProcessTree$UnixProcess.killRecursively(ProcessTree.java:573) at hudson.util.ProcessTree$UnixProcess.killRecursively(ProcessTree.java:572) at hudson.util.ProcessTree$Unix.killAll(ProcessTree.java:497) at hudson.Launcher$LocalLauncher.kill(Launcher.java:798) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:546) at hudson.model.Run.execute(Run.java:1700) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231)
          Hide
          orrc Christopher Orr added a comment -

          According to the "upcoming changes" link in the changelog, it will be available in 1.560.

          Show
          orrc Christopher Orr added a comment - According to the "upcoming changes" link in the changelog, it will be available in 1.560.
          Hide
          jglick Jesse Glick added a comment -

          Pity this was not backported to the 1.554.x line.

          Show
          jglick Jesse Glick added a comment - Pity this was not backported to the 1.554.x line.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christopher Orr
          Path:
          pom.xml
          http://jenkins-ci.org/commit/android-emulator-plugin/04b4015877bf359816afd22adb54e3a58b3bb154
          Log:
          Bump Jenkins requirement to 1.565.1.

          This is the first LTS version with the fix for JENKINS-21341, which we require.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: pom.xml http://jenkins-ci.org/commit/android-emulator-plugin/04b4015877bf359816afd22adb54e3a58b3bb154 Log: Bump Jenkins requirement to 1.565.1. This is the first LTS version with the fix for JENKINS-21341 , which we require.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/util/ProcessTree.java
          http://jenkins-ci.org/commit/jenkins/90e989827e9e7a826c12997d7f7109ac21b0411b
          Log:
          [FIXED JENKINS-21341] Merge pull request #1169 from pliljenberg/master

          Ugly hack to fix destroyProcess for Java8

          (cherry picked from commit 19640e7b4aa6d54865bc0816b604f4c0a9add6b6)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/util/ProcessTree.java http://jenkins-ci.org/commit/jenkins/90e989827e9e7a826c12997d7f7109ac21b0411b Log: [FIXED JENKINS-21341] Merge pull request #1169 from pliljenberg/master Ugly hack to fix destroyProcess for Java8 (cherry picked from commit 19640e7b4aa6d54865bc0816b604f4c0a9add6b6)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/util/ProcessTree.java
          http://jenkins-ci.org/commit/jenkins/90e989827e9e7a826c12997d7f7109ac21b0411b
          Log:
          [FIXED JENKINS-21341] Merge pull request #1169 from pliljenberg/master

          Ugly hack to fix destroyProcess for Java8

          (cherry picked from commit 19640e7b4aa6d54865bc0816b604f4c0a9add6b6)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/util/ProcessTree.java http://jenkins-ci.org/commit/jenkins/90e989827e9e7a826c12997d7f7109ac21b0411b Log: [FIXED JENKINS-21341] Merge pull request #1169 from pliljenberg/master Ugly hack to fix destroyProcess for Java8 (cherry picked from commit 19640e7b4aa6d54865bc0816b604f4c0a9add6b6)
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #3989
          [FIXED JENKINS-21341] Merge pull request #1169 from pliljenberg/master (Revision 90e989827e9e7a826c12997d7f7109ac21b0411b)

          Result = SUCCESS
          jesse glick : 90e989827e9e7a826c12997d7f7109ac21b0411b
          Files :

          • core/src/main/java/hudson/util/ProcessTree.java
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3989 [FIXED JENKINS-21341] Merge pull request #1169 from pliljenberg/master (Revision 90e989827e9e7a826c12997d7f7109ac21b0411b) Result = SUCCESS jesse glick : 90e989827e9e7a826c12997d7f7109ac21b0411b Files : core/src/main/java/hudson/util/ProcessTree.java
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 153205 ] JNJira + In-Review [ 194507 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              audumla Marius Gleeson
            • Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: