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

Endless loop when evaluating environment variables

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Recreation

      Have 2 jobs:
      Job 1 triggers Job 2 using the "Trigger/call builds on other projects"
      Uses "Predefined parameter": test_loop=${test_loop}

      Job 2 uses "Create a formatted version number" where:
      "Environment Variable Name": test_loop
      "Version Number Format String": ${test_loop}

      Outcome

      This causes the Job 2 to be stuck in an endless loop as test_loop keeps getting translated into ${test_loop} and tries to be translated again and again...

      threadDump looks as follows:

       Executor #0 for master : executing test_endless_loop #5
      "Executor #0 for master : executing test_endless_loop #5" Id=116 Group=main RUNNABLE
      	at org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.formatVersionNumber(VersionNumberBuilder.java:341)
      	at org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.setUp(VersionNumberBuilder.java:364)
      ...
      

      I stumbled on this by accident and this configuration should be avoided, but still it causes a job to be stuck in an endless loop which could not be stopped.
      Stopping it was only by restarting the server.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Deniz Bahadir
          Path:
          src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberCommon.java
          http://jenkins-ci.org/commit/versionnumber-plugin/6fcbe020d318bccf33739344c4a063203f79b825
          Log:
          JENKINS-26729 Fixed infinite loop.

          In some situations where an environment variable resolves to itself it
          the plugin could get stuck in an infinite loop.
          This is fixed now, because the plugin now checks for such situations and
          then does not resolve such bad envionrment variables.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Deniz Bahadir Path: src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberCommon.java http://jenkins-ci.org/commit/versionnumber-plugin/6fcbe020d318bccf33739344c4a063203f79b825 Log: JENKINS-26729 Fixed infinite loop. In some situations where an environment variable resolves to itself it the plugin could get stuck in an infinite loop. This is fixed now, because the plugin now checks for such situations and then does not resolve such bad envionrment variables.
          Hide
          bahadir Deniz Bahadir added a comment -

          Fixed in release 1.8.1.

          Show
          bahadir Deniz Bahadir added a comment - Fixed in release 1.8.1.

            People

            • Assignee:
              bahadir Deniz Bahadir
              Reporter:
              jasonw Jason W
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: