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

Pipeline: StackOverflowError at io.jenkins.blueocean.events.PipelineEventListener$StageEventPublisher.getParentBlock(PipelineEventListener.java:110)

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • blueocean-plugin
    • None
    • Jenkins Version: 2.44
      Pipeline Groovy: 2.36
      Blue Ocean: 1.1.2
    • Blue Ocean - Candidates

      When executing a Pipeline script with a long-running loop that uses nested closures, a StackOverflowError occurs and the job aborts abruptly.

       

      Reproduction steps:

      1. Create a Pipeline job with this as the script:
        1. def finished = false
          def someMap = ['foo':'bar', 'baz':'spam']
          def someOtherMap = ['foo':'baz', 'baz':'bar']
          node {
            def incr = 0
            while (true) {
              someMap.each{ foo, bar ->
                sh "echo ${foo} ${bar} ${incr}"
                incr++
                someOtherMap.each{ baz, spam ->
                  sh "echo ${baz} ${spam} ${incr}"
                }
              }
            }
          }
      1. Run the job
      2. Wait for about an hour. For me, the loop executes nearly 4000 times before the error. Maybe easier to reproduce on a smaller stack.

      Attached is the (not-very-interesting) resultant stack trace.

          [JENKINS-45488] Pipeline: StackOverflowError at io.jenkins.blueocean.events.PipelineEventListener$StageEventPublisher.getParentBlock(PipelineEventListener.java:110)

          Zack Young created issue -
          Andrew Bayer made changes -
          Component/s New: blueocean-plugin [ 21481 ]
          Component/s Original: pipeline [ 21692 ]
          James Dumay made changes -
          Epic Link New: JENKINS-43953 [ 181485 ]
          James Dumay made changes -
          Sprint New: Blue Ocean 1.3 [ 296 ]
          Zack Young made changes -
          Environment Original: Jenkins Version: 2.44
          Pipeline Groovy: 2.36
          New: Jenkins Version: 2.44
          Pipeline Groovy: 2.36
          Blue Ocean: 1.1.2
          James Dumay made changes -
          Sprint Original: Blue Ocean 1.3-beta-2 [ 296 ] New: Blue Ocean 1.4 [ 311 ]
          James Dumay made changes -
          Rank New: Ranked higher
          James Dumay made changes -
          Sprint Original: Blue Ocean 1.4 [ 311 ] New: Blue Ocean 1.3 - candidates [ 326 ]
          James Dumay made changes -
          Rank New: Ranked lower
          James Dumay made changes -
          Assignee New: Vivek Pandey [ vivek ]
          James Dumay made changes -
          Sprint Original: Blue Ocean 1.4 - candidates [ 326 ] New: Blue Ocean 1.4 - beta 2 [ 416 ]
          James Dumay made changes -
          Rank New: Ranked higher

            olamy Olivier Lamy
            xathien Zack Young
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: