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

Update breaks compound assignments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • script-security 1244.ve463715a_f89c

      After upgrading plugins to the versions specified in Environment, our build jobs started failing with the following error: 

      java.lang.VerifyError: (class: com/codemanufaktur/rbs/tools/conan/ConanBuildTask, method: <init> signature: (Ljava/util/Map;)V) Unable to pop operand off an empty stack
      	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
      	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
      	at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2357)
      	at org.kohsuke.groovy.sandbox.impl.GroovyCallSiteSelector.constructor(GroovyCallSiteSelector.java:67)
      	at org.kohsuke.groovy.sandbox.impl.GroovyCallSiteSelector.findConstructor(GroovyCallSiteSelector.java:45)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:223)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.constructorCall(SandboxInvoker.java:21)
      	at com.codemanufaktur.rbs.tools.conan.ConanBuilder.createTask(ConanBuilder.groovy:87)
      	at com.codemanufaktur.rbs.tools.conan.ConanBuilder.buildTasks(ConanBuilder.groovy:102)
      	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.collect(CpsDefaultGroovyMethods:3287)
      	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.collect(CpsDefaultGroovyMethods:3257)
      	at com.codemanufaktur.rbs.tools.conan.ConanBuilder.buildTasks(ConanBuilder.groovy:102)
      	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.callClosureForMapEntry(CpsDefaultGroovyMethods:5361)
      	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.collectMany(CpsDefaultGroovyMethods:3485)
      	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.collectMany(CpsDefaultGroovyMethods:3506)
      	at com.codemanufaktur.rbs.tools.conan.ConanBuilder.buildTasks(ConanBuilder.groovy:99)
      	at com.codemanufaktur.rbs.tools.conan.ConanBuilder.run(ConanBuilder.groovy:49)
      	at com.codemanufaktur.rbs.pipeline.Pipeline.build(Pipeline.groovy:64)
      	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2125)
      	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2110)
      	at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2151)
      	at com.codemanufaktur.rbs.pipeline.Pipeline.build(Pipeline.groovy:63)
      	at pipelineFactory.call(pipelineFactory.groovy:51)
      	at ___cps.transform___(Native Method)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:85)
      	at jdk.internal.reflect.GeneratedMethodAccessor317.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
      	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
      	at jdk.internal.reflect.GeneratedMethodAccessor367.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:75)
      	at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
      	at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:65)
      	at jdk.internal.reflect.GeneratedMethodAccessor363.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:158)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:152)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:152)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:187)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:420)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:95)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:330)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:294)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:30)
      	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:70)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)

      After a downgrade of the following plugins to the following versions, everything started working again.

      git:4.12.1
      git-client:3.12.1
      junit:1156.vcf492e95a_a_b_0
      pipeline-groovy-lib:612.v84da_9c54906d
      script-security:1183.v774b_0b_0a_a_451
      workflow-cps:2802.v5ea_628154b_c2

      It seems to me that the fix for SECURITY-2824 introduced this problem. I'll try to boil this down to a MCVE, but in the mean time, here is the code in question:

      // from class ConanBuilder
          private ConanBuildTask createTask(String tag, String hostProfile) {
              new ConanBuildTask(
                  recipe: this.recipe,
                  hostProfile: hostProfile,
                  buildProfile: this.buildProfile,
                  tag: tag,
                  remotes: this.remotes,
                  stageRemote: this.stageRemote,
                  config: this.config
              )
          }
      
          private List<ConanBuildTask> buildTasks() {
              return artefacts?.findAll { tag, _ -> !this.tags || tag in this.tags }
                  .collectMany { tag, profiles ->
                      if (profiles in Collection) {
                          return profiles.collect { profile -> createTask(tag, profile) }
                      }
                      return createTask(tag, profiles)
                  }
          }
      
      class ConanBuildTask
      {
          ConanBuildTask(Map params)
          {
              // never reached
          }
      }
      

            dnusbaum Devin Nusbaum
            lho Lennart
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: