[JIRA] (JENKINS-61423) StackOverFlowException when using matrix jobs

9 views
Skip to first unread message

ch.fetzer@gmx.net (JIRA)

unread,
Mar 11, 2020, 4:07:14 AM3/11/20
to jenkinsc...@googlegroups.com
Christoph Fetzer created an issue
 
Jenkins / Bug JENKINS-61423
StackOverFlowException when using matrix jobs
Issue Type: Bug Bug
Assignee: Kohsuke Kawaguchi
Components: matrix-project-plugin, pipeline
Created: 2020-03-11 08:06
Environment: Jenkins ver. 2.204.5
Priority: Critical Critical
Reporter: Christoph Fetzer

I am currently trying to set up a matrix build and whenever I have an axis with more than one values I run into a StackOverFlowException.

This is my Pipeline (declarative):

Comments:

  • I am not sure if customWorkspace will do what I want, that's currently only a try. Does anybody happen to have an idea how to use external-workspace-plugin from declarative pipelines?
  • the pipeline is edited for removing internal information, thus there might be unexpetced syntax issues
#!groovy
pipeline {
    agent 
    {
    	node {
		    label ''
		    customWorkspace "${JOB_NAME}/workspace"
		}		    
	}
    
    options { timestamps () }
    stages {
        stage('Build') {
        	environment {
		    BUSY_HOME = "${BUSYDIR}"
		    BUSY_CMD = "${BUSYDIR}\\myBuildSystem.cmd"                    
		    CVS_CREDENTIALS = credentials('BuildUser')
		}
        	matrix {
        	    axes {
        	        axis {
        	            name 'PLATFORM'
        	            values 'win32vc9'        	            
        	        }
        	        axis {
        	            name 'MODULE'
        	            values 'repo1/module1', 'repo2/module2'
        	        }
        	        axis {
        	            name 'VARIANT'
        	            values 'debug'      	            
        	        }
        	    }
        	    stages {
        	        stage( 'Checkout' ) {
				environment {
				    BUSY_VARIANT = "${VARIANT}"                    
				    CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
				    CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
				    CVS_CREDENTIALS = credentials('BuildUser')
	         		}
		            	steps {
								checkout changelog: true, poll: true, scm: [$class: 'CVSSCM', canUseUpdate: true, checkoutCurrentTimestamp: false
                					, cleanOnFailedUpdate: false, disableCvsQuiet: false, forceCleanCopy: false, legacy: false, pruneEmptyDirectories: true
                    				, repositories: [[compressionLevel: -1, cvsRoot: ":pserver:${CVS_CREDENTIALS_USR}@MYCVS/${CVS_REPOSITORY}", excludedRegions: [[pattern: '']]
                    				, password: "${CVS_CREDENTIALS_PSW}", passwordRequired: true, repositoryItems: [[location: [$class: 'HeadRepositoryLocation']
                    				, modules: [[localName: "${CVS_REPOSITORY}/${CVS_PATH}", remoteName: "${CVS_PATH}"]]]]]], skipChangeLog: false]
                    		}
        	        }
        	        stage( 'Build' ) {
						environment {
							BUSY_VARIANT = "${VARIANT}"                    
							CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
							CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
	         			}
						steps {
            				bat """					
						
								pushd "${MODULE}"
								call  %BUSY_CMD% BUSY_ROOT:%WORKSPACE% BUSY_PLATFORM:${PLATFORM} r -e default
								popd"""
				                recordIssues enabledForFailure: true, sourceCodeEncoding: 'ISO-8859-1',
                						healthy: 1,
                    					tools: [ msBuild( id: "${MODULE}_${PLATFORM}_${VARIANT}" ) ]
                    		}
        	        }        	        stage( 'Test' ) {
						environment {
							BUSY_VARIANT = "${VARIANT}"                    
							CVS_REPOSITORY = MODULE.substring( 0, MODULE.indexOf('/') )
							CVS_PATH = MODULE.substring( MODULE.indexOf('/') + 1 , MODULE.length() )
	         			}
						steps {
            				bat """					
					
								pushd "${MODULE}"
								call  %BUSY_CMD% BUSY_ROOT:%WORKSPACE% BUSY_PLATFORM:${PLATFORM} r -e run-test
								popd"""
						}
        	        }
        	    }
        	}
        }
    }
    post {
        always {
            script {
                def mailbody = '${SCRIPT, template="groovy_html.template"}'
                def mailsubject = 'Jenkins Build ' + currentBuild.fullDisplayName + ' finished: ' + currentBuild.currentResult
                emailext attachLog: false, body: mailbody, recipientProviders: [culprits(), brokenTestsSuspects(), brokenBuildSuspects(), upstreamDevelopers()], subject: mailsubject
            }
        }
    }
}

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

ch.fetzer@gmx.net (JIRA)

unread,
Mar 11, 2020, 4:08:02 AM3/11/20
to jenkinsc...@googlegroups.com
Christoph Fetzer commented on Bug JENKINS-61423
 
Re: StackOverFlowException when using matrix jobs

This is the jenkins output:

Started by user USER
Lightweight checkout support not available, falling back to full checkout.
Checking out hudson.scm.CVSSCM into D:\workdir\build\Build-all\workspace@script to read Jenkins/Jenkinsfile-all
Using locally configured password for connection to :pserver:USER@SERVER:2401/build
cvs checkout -P -D 11 Mar 2020 08:28:22 +0100 -d Jenkins Jenkins 
cvs server: Updating Jenkins
U Jenkins/Jenkinsfile-all
Using locally configured password for connection to :pserver:USER@SERVER:2401/build
cvs rlog -S -d10 Mar 2020 22:01:00 +0100<11 Mar 2020 08:28:22 +0100 Jenkins 
cvs rlog: Logging Jenkins
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in D:\workdir\build\Build-all\workspace
[Pipeline] {
[Pipeline] ws
Running in D:\workdir\.jenkins\Build-all\workspace
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
Using locally configured password for connection to :pserver:USER@SERVER:2401/build
cvs checkout -P -D 11 Mar 2020 08:28:22 +0100 -d Jenkins Jenkins 
cvs server: Updating Jenkins
U Jenkins/Jenkinsfile-all
Using locally configured password for connection to :pserver:USER@SERVER:2401/build
cvs rlog -S -d10 Mar 2020 22:01:00 +0100<11 Mar 2020 08:28:22 +0100 Jenkins 
cvs rlog: Logging Jenkins
[Pipeline] }
[Pipeline] // stage
[Pipeline] timestamps
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] withCredentials
08:28:48  Masking supported pattern matches of %CVS_CREDENTIALS% or %CVS_CREDENTIALS_USR% or %CVS_CREDENTIALS_PSW%
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] parallel
[Pipeline] { (Branch: Matrix - MODULE = 'repo1/module1')
[Pipeline] { (Branch: Matrix - MODULE = 'repo2/module1')
[Pipeline] stage
[Pipeline] { (Matrix - MODULE = 'repo1/module1')
[Pipeline] stage
[Pipeline] { (Matrix - MODULE = 'repo2/module1')
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout)
[Pipeline] stage
[Pipeline] { (Checkout)
[Pipeline] withCredentials
08:28:48  Masking supported pattern matches of %CVS_CREDENTIALS% or %CVS_CREDENTIALS_USR% or %CVS_CREDENTIALS_PSW%
[Pipeline] withCredentials
08:28:49  Masking supported pattern matches of %CVS_CREDENTIALS% or %CVS_CREDENTIALS_USR% or %CVS_CREDENTIALS_PSW%
[Pipeline] End of Pipeline
java.lang.StackOverflowError
	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:114)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
[ removed a lot iterations of an endless loop ]
	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1082)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1040)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
	at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:920)
Finished: FAILURE

ch.fetzer@gmx.net (JIRA)

unread,
Mar 11, 2020, 4:11:02 AM3/11/20
to jenkinsc...@googlegroups.com
Christoph Fetzer updated an issue
 
Change By: Christoph Fetzer
I am currently trying to set up a matrix build and whenever I have an axis with more than one values I run into a StackOverFlowException.

This is my Pipeline (declarative):

Comments:
* I am not sure if customWorkspace will do what I want, that's currently only a try. Does anybody happen to have an idea how to use external-workspace-plugin from declarative pipelines?
* the pipeline is edited for removing internal information, thus there might be unexpetced syntax issues
* My feeling is there is a connection with another step used here like credentials or customworkspace because I can remember I've seen arunning pipeline in the past only with temporary workspaces on every build stage so missing all the checked out code. I'm trying to reproduce this and deliver that information later.

{code:java}

#!groovy
pipeline {
    agent
    {
     node {
      label ''
      customWorkspace "${JOB_NAME}/workspace"
  }      
}
    
    options { timestamps () }
    stages {
        stage('Build') {
         environment {
      BUSY_HOME = "${BUSYDIR}"
      BUSY_CMD = "${BUSYDIR}\\myBuildSystem.cmd"                    
      CVS_CREDENTIALS = credentials('BuildUser')
  }
         matrix {
             axes {
                 axis {
                     name 'PLATFORM'
                     values 'win32vc9'                    
                 }
                 axis {
                     name 'MODULE'
                     values 'repo1/module1', 'repo2/ module2 module1 '
{code}

ch.fetzer@gmx.net (JIRA)

unread,
Mar 11, 2020, 4:46:02 AM3/11/20
to jenkinsc...@googlegroups.com
 
Re: StackOverFlowException when using matrix jobs

OK, I had a 1:1 translation from matrix axis names to the environment with a different name, that caused the trouble. When accessing the axis names directly, everything started to work.

 

Here the issue:
matrix {
axes {
axis

{ name 'PLATFORM' values 'win32vc9' }

axis

{ name 'MODULE' values 'repo1/module1', 'repo2/module1' }

axis

{ name 'VARIANT' values 'debug' }

}
stages {
stage( 'Checkout' )
environment {

// removing the next line and accessing the content with %VARIANT% or ${VARIANT} directly or renaming the axis to "BUSY_VARIANT" solved the problem
BUSY_VARIANT = "${VARIANT}"

}
...

 

I am not sure if this still is a bug or not. Though might be interesting for otherones to be able to find a solution.

ch.fetzer@gmx.net (JIRA)

unread,
Mar 11, 2020, 4:49:02 AM3/11/20
to jenkinsc...@googlegroups.com
Christoph Fetzer edited a comment on Bug JENKINS-61423
OK, I had a 1:1 translation from matrix axis names to the environment with a different name, that caused the trouble. When accessing the axis names directly, everything started to work.

 

Here the issue:
{code:java}
matrix {
    axes {
        axis {


            name 'PLATFORM'            values 'win32vc9'
                     }
        axis {


            name 'MODULE'            values 'repo1/module1', 'repo2/module1'
        }
        axis {


            name 'VARIANT'            values 'debug'
                     }
   }
   stages {
       stage( 'Checkout' )
   

        {
            environment {
                // removing the next line and accessing the content with %VARIANT% or ${VARIANT} directly or renaming the axis to "BUSY_VARIANT" solved the problem
  BUSY_VARIANT = "${VARIANT}"
               

            }
...
   
 
{code}

I am not sure if this still is a bug or not. Though might be interesting for otherones to be able to find a solution.

ch.fetzer@gmx.net (JIRA)

unread,
Mar 11, 2020, 6:22:03 AM3/11/20
to jenkinsc...@googlegroups.com

Hm, there seem to be additional correlations:

  • when I add an environment to another stage looking like this
stage( 'Build' ) {
    environment {
        MODULE_PATH = MODULE.replace( "/", "\\");
    }
}
  • when I enable the credentials step again

the StackOverFlow is back again

 

 

Reply all
Reply to author
Forward
0 new messages