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

          Daniel Spilker created issue -
          Daniel Spilker made changes -
          Link New: This issue is related to JENKINS-34525 [ JENKINS-34525 ]
          Daniel Spilker made changes -
          Link New: This issue is related to JENKINS-21249 [ JENKINS-21249 ]

          Daniel Spilker added a comment - Here is a fix for Groovy: https://github.com/apache/groovy/pull/333

          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.
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-14044 [ JENKINS-14044 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-34765 [ JENKINS-34765 ]

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

              Created:
              Updated:
              Resolved: