Due to a regression in Groovy 2.4 (GROOVY-7826) scripts using some of the core classes with complex generic type arguments (e.g. hudson.model.Run or hudson.model.Job) will cause a StackoverflowError.

      Run this script in Script Console to reproduce the problem:

      def foo(hudson.model.Run run) {}
      

      This affects Script Console, Pipeline, Job DSL, Groovy plugin (system Groovy script) and probably other plugins using the Groovy runtime provided by Jenkins core.

      java.lang.StackOverflowError
      	at java.lang.StringBuilder.append(StringBuilder.java:132)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1173)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1159)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1178)
      	at org.codehaus.groovy.ast.ClassNode.genericTypeAsString(ClassNode.java:1199)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1173)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1159)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1178)
      	at org.codehaus.groovy.ast.ClassNode.genericTypeAsString(ClassNode.java:1199)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1173)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1159)
      	at org.codehaus.groovy.ast.ClassNode.toString(ClassNode.java:1178)
      	at org.codehaus.groovy.ast.ClassNode.genericTypeAsString(ClassNode.java:1199)
              ...
      

          [JENKINS-34751] StackOverflowError in Groovy scripts

          John Wynne added a comment - - edited

          I can see a fix included in groovy 2.4.7 but there is no planned release for it.
          Will we have to wait for groovy to release and then for jenkins to consume it before we see this fixed? If so, I'll need to downgrade from 2.x sharpish
          https://issues.apache.org/jira/browse/GROOVY/fixforversion/12334898/?selectedTab=com.atlassian.jira.jira-projects-plugin:version-summary-panel

          Alternatively, daspilker are there instructions for pulling that fix on github that you've posted into my jenkins installation?

          John Wynne added a comment - - edited I can see a fix included in groovy 2.4.7 but there is no planned release for it. Will we have to wait for groovy to release and then for jenkins to consume it before we see this fixed? If so, I'll need to downgrade from 2.x sharpish https://issues.apache.org/jira/browse/GROOVY/fixforversion/12334898/?selectedTab=com.atlassian.jira.jira-projects-plugin:version-summary-panel Alternatively, daspilker are there instructions for pulling that fix on github that you've posted into my jenkins installation?

          I hope to get a Groovy 2.4.x release for the first 2.x LTS release, which will come in a few weeks.

          johnwynne you can pull the GROOVY_2_4_X branch from GitHub (https://github.com/apache/groovy/tree/GROOVY_2_4_X), run the build (instructions are in the README) and then replace the Groovy JAR in your Jenkins installation (e.g. in /var/cache/jenkins/war/WEB-INF/lib) with the JAR from the build (in target/libs).

          Daniel Spilker added a comment - I hope to get a Groovy 2.4.x release for the first 2.x LTS release, which will come in a few weeks. johnwynne you can pull the GROOVY_2_4_X branch from GitHub ( https://github.com/apache/groovy/tree/GROOVY_2_4_X ), run the build (instructions are in the README) and then replace the Groovy JAR in your Jenkins installation (e.g. in /var/cache/jenkins/war/WEB-INF/lib) with the JAR from the build (in target/libs).

          Daniel Beck added a comment -

          daspilker While we release 2.x.1 LTS on July 6, we decide the baseline on June 8 and the version we choose is typically 3-4 weeks old. I.e. now.

          If this is supposed to be fixed for 2.x.1 LTS in July, we need to go the patched Groovy route again, and quickly.

          Daniel Beck added a comment - daspilker While we release 2.x.1 LTS on July 6, we decide the baseline on June 8 and the version we choose is typically 3-4 weeks old. I.e. now. If this is supposed to be fixed for 2.x.1 LTS in July, we need to go the patched Groovy route again, and quickly.

          danielbeck Arg. I will ask on the Groovy dev list. The last 2.4 release is 3 month old, so it should be time to cut a release.

          Daniel Spilker added a comment - danielbeck Arg. I will ask on the Groovy dev list. The last 2.4 release is 3 month old, so it should be time to cut a release.

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/a3ddc89afe27a52554a79ff9e6d1b2ec714f96cd
          Log:
          JENKINS-34751 use patched version of Groovy 2.4.6 (#2369)

          contains fixes for GROOVY-7761 and GROOVY-7826

          [FIXES JENKINS-34751]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/a3ddc89afe27a52554a79ff9e6d1b2ec714f96cd Log: JENKINS-34751 use patched version of Groovy 2.4.6 (#2369) contains fixes for GROOVY-7761 and GROOVY-7826 [FIXES JENKINS-34751]

          Oleg Nenashev added a comment -

          The fix has been released in jenkins-2.7
          Now we need to upgrade to 2.4.7 once it gets released

          Oleg Nenashev added a comment - The fix has been released in jenkins-2.7 Now we need to upgrade to 2.4.7 once it gets released

          Follow-up PR to update to Groovy 2.4.7: https://github.com/jenkinsci/jenkins/pull/2399

          Daniel Spilker added a comment - Follow-up PR to update to Groovy 2.4.7: https://github.com/jenkinsci/jenkins/pull/2399

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/96a782853eb006d76eb8eb2aad68d3046a5f9756
          Log:
          updated Groovy to 2.4.7

          follow-up for JENKINS-34751

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/96a782853eb006d76eb8eb2aad68d3046a5f9756 Log: updated Groovy to 2.4.7 follow-up for JENKINS-34751

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/057791ca34c8f85080ca1f4957843fb7c72b615b
          Log:
          Merge pull request #2399 from daspilker/JENKINS-34751

          JENKINS-34751 updated Groovy to 2.4.7

          Compare: https://github.com/jenkinsci/jenkins/compare/f1dfc7207fc3...057791ca34c8

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/057791ca34c8f85080ca1f4957843fb7c72b615b Log: Merge pull request #2399 from daspilker/ JENKINS-34751 JENKINS-34751 updated Groovy to 2.4.7 Compare: https://github.com/jenkinsci/jenkins/compare/f1dfc7207fc3...057791ca34c8

          Backporting bump to 2.4.7 into 2.7.1 not to depend on forked build.

          Oliver Gondža added a comment - Backporting bump to 2.4.7 into 2.7.1 not to depend on forked build.

            daspilker Daniel Spilker
            daspilker Daniel Spilker
            Votes:
            2 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: