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

hudson.Launcher:ProcStarter::envs() may throw NPE

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Jenkins 1.509.3 - 1.537

      ProcStarter::envs() calls envs.clone(), but does not check envs variable for null. BTW, the variable may be null in the following case (see JENKINS-19506):

      • There are several wrappers
      • One of wrappers triggers remote call (Launcher::launch()) in setUp() or decorateLauncher() methods to setup variables (example: android-emulator) => it will make all other launchers to provide their environment variables
      • One of other wrappers retrieves ProcStarter.envs() in setUp() or decorateLauncher()
      • envs are empty for nested call => execution of other wrapper causes NPE inside core

          [JENKINS-20559] hudson.Launcher:ProcStarter::envs() may throw NPE

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/Launcher.java
          http://jenkins-ci.org/commit/jenkins/ef943a3ee69529a9f41353f134043ed3363f12e0
          Log:
          [FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of environment variables list

          Resolves https://issues.jenkins-ci.org/browse/JENKINS-20559
          BTW, I also need to add some tests to "Test Harness" in order to improve coverage of nested operations.
          These test require a fix for https://issues.jenkins-ci.org/browse/JENKINS-19454

          Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/Launcher.java http://jenkins-ci.org/commit/jenkins/ef943a3ee69529a9f41353f134043ed3363f12e0 Log: [FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of environment variables list Resolves https://issues.jenkins-ci.org/browse/JENKINS-20559 BTW, I also need to add some tests to "Test Harness" in order to improve coverage of nested operations. These test require a fix for https://issues.jenkins-ci.org/browse/JENKINS-19454 Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          test/src/test/java/hudson/ProcStarterTest.java
          http://jenkins-ci.org/commit/jenkins/c5d01b0645a12e64e2a256641b18989c2f68eeea
          Log:
          JENKINS-20559 - A direct test for the bug

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: test/src/test/java/hudson/ProcStarterTest.java http://jenkins-ci.org/commit/jenkins/c5d01b0645a12e64e2a256641b18989c2f68eeea Log: JENKINS-20559 - A direct test for the bug Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/Launcher.java
          test/src/test/java/hudson/ProcStarterTest.java
          http://jenkins-ci.org/commit/jenkins/4d4ca20a241aac64d000cc29bc27e7f1c1920f94
          Log:
          Merge pull request #1013 from synopsys-arc-oss/launcher_fixes

          [FIXED JENKINS-20559 and JENKINS-19454] - hudson.Launcher bugfix and additional wrapper

          Compare: https://github.com/jenkinsci/jenkins/compare/4f41d2aa28d6...4d4ca20a241a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/Launcher.java test/src/test/java/hudson/ProcStarterTest.java http://jenkins-ci.org/commit/jenkins/4d4ca20a241aac64d000cc29bc27e7f1c1920f94 Log: Merge pull request #1013 from synopsys-arc-oss/launcher_fixes [FIXED JENKINS-20559 and JENKINS-19454] - hudson.Launcher bugfix and additional wrapper Compare: https://github.com/jenkinsci/jenkins/compare/4f41d2aa28d6...4d4ca20a241a

          Oleg Nenashev added a comment -

          The issue will be fixed in 1.567

          Oleg Nenashev added a comment - The issue will be fixed in 1.567

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3432
          [FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of environment variables list (Revision ef943a3ee69529a9f41353f134043ed3363f12e0)
          JENKINS-20559 - A direct test for the bug (Revision c5d01b0645a12e64e2a256641b18989c2f68eeea)

          Result = SUCCESS
          o.v.nenashev : ef943a3ee69529a9f41353f134043ed3363f12e0
          Files :

          • core/src/main/java/hudson/Launcher.java

          o.v.nenashev : c5d01b0645a12e64e2a256641b18989c2f68eeea
          Files :

          • test/src/test/java/hudson/ProcStarterTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3432 [FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of environment variables list (Revision ef943a3ee69529a9f41353f134043ed3363f12e0) JENKINS-20559 - A direct test for the bug (Revision c5d01b0645a12e64e2a256641b18989c2f68eeea) Result = SUCCESS o.v.nenashev : ef943a3ee69529a9f41353f134043ed3363f12e0 Files : core/src/main/java/hudson/Launcher.java o.v.nenashev : c5d01b0645a12e64e2a256641b18989c2f68eeea Files : test/src/test/java/hudson/ProcStarterTest.java

          Daniel Beck added a comment -

          Is this serious and safe enough for LTS inclusion?

          Daniel Beck added a comment - Is this serious and safe enough for LTS inclusion?

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - The functional change: https://github.com/jenkinsci/jenkins/commit/ef943a3ee69529a9f41353f134043ed3363f12e0 It's definitely safe

          Daniel Beck added a comment -

          Nominating ef943a3ee69529a9f41353f134043ed3363f12e0 for LTS.

          Daniel Beck added a comment - Nominating ef943a3ee69529a9f41353f134043ed3363f12e0 for LTS.

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/Launcher.java
          http://jenkins-ci.org/commit/jenkins/1273668ba3b47fd344405ba4c49ec5a83ea9b508
          Log:
          [FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of environment variables list

          Resolves https://issues.jenkins-ci.org/browse/JENKINS-20559
          BTW, I also need to add some tests to "Test Harness" in order to improve coverage of nested operations.
          These test require a fix for https://issues.jenkins-ci.org/browse/JENKINS-19454

          Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>
          (cherry picked from commit ef943a3ee69529a9f41353f134043ed3363f12e0)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/Launcher.java http://jenkins-ci.org/commit/jenkins/1273668ba3b47fd344405ba4c49ec5a83ea9b508 Log: [FIXED JENKINS-20559] - ProcStarter: Check for null before cloning of environment variables list Resolves https://issues.jenkins-ci.org/browse/JENKINS-20559 BTW, I also need to add some tests to "Test Harness" in order to improve coverage of nested operations. These test require a fix for https://issues.jenkins-ci.org/browse/JENKINS-19454 Signed-off-by: Oleg Nenashev <nenashev@synopsys.com> (cherry picked from commit ef943a3ee69529a9f41353f134043ed3363f12e0)

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          test/src/test/java/hudson/ProcStarterTest.java
          http://jenkins-ci.org/commit/jenkins/0ce7ad2ca208ff24ce49fdbd16157d2abed4328c
          Log:
          JENKINS-20559 - A direct test for the bug

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
          (cherry picked from commit c5d01b0645a12e64e2a256641b18989c2f68eeea)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: test/src/test/java/hudson/ProcStarterTest.java http://jenkins-ci.org/commit/jenkins/0ce7ad2ca208ff24ce49fdbd16157d2abed4328c Log: JENKINS-20559 - A direct test for the bug Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com> (cherry picked from commit c5d01b0645a12e64e2a256641b18989c2f68eeea)

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: