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

StackOverflowError in Groovy scripts

    Details

    • Similar Issues:

      Description

      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)
              ...
      

        Attachments

          Issue Links

            Activity

            Hide
            daspilker Daniel Spilker added a comment -
            Show
            daspilker Daniel Spilker added a comment - Here is a fix for Groovy: https://github.com/apache/groovy/pull/333
            Hide
            johnwynne 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, Daniel Spilker are there instructions for pulling that fix on github that you've posted into my jenkins installation?

            Show
            johnwynne 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, Daniel Spilker are there instructions for pulling that fix on github that you've posted into my jenkins installation?
            Hide
            daspilker 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.

            John Wynne 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).

            Show
            daspilker 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. John Wynne 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).
            Hide
            danielbeck Daniel Beck added a comment -

            Daniel Spilker 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.

            Show
            danielbeck Daniel Beck added a comment - Daniel Spilker 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.
            Hide
            daspilker Daniel Spilker added a comment -

            Daniel Beck 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.

            Show
            daspilker Daniel Spilker added a comment - Daniel Beck 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.
            Hide
            scm_issue_link 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]

            Show
            scm_issue_link 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]
            Hide
            oleg_nenashev 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

            Show
            oleg_nenashev 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
            Hide
            daspilker Daniel Spilker added a comment -

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

            Show
            daspilker Daniel Spilker added a comment - Follow-up PR to update to Groovy 2.4.7: https://github.com/jenkinsci/jenkins/pull/2399
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            olivergondza Oliver Gondža added a comment -

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

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

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                daspilker Daniel Spilker
              • Votes:
                2 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: