Skip to content

Conversation

@jglick
Copy link
Member

@jglick jglick commented Feb 13, 2025

@jglick jglick requested review from Vlatombe and dwnusbaum February 13, 2025 20:30
@jglick jglick changed the title Placeholder for batch diagnostic tool for StackOverflowErrors Batch diagnostic tool for StackOverflowErrors Feb 13, 2025
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<!-- TODO https://github.com/jenkinsci/workflow-cps-plugin/pull/988 -->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +182 to +206
<dependency>
<groupId>org.csanchez.jenkins.plugins</groupId>
<artifactId>kubernetes</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>pipeline-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkinsci.plugins</groupId>
<artifactId>pipeline-model-definition</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>warnings-ng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>parallel-test-executor</artifactId>
<scope>test</scope>
</dependency>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just whatever plugins I found in my sample program.dat. Ideally the test input would let you specify a list of plugin archives or something like that. Or maybe there is some way to ask Unmarshaller to just skip over objects with unrecognized types.

System.err.println("Loaded.");
} catch (Exception x) {
x.printStackTrace();
build.writeWholeLogTo(System.err);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what actuallly shows the issue.

@jglick
Copy link
Member Author

jglick commented Feb 21, 2025

Example output
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed loading heads
	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:595)
	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:554)
	at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:111)
	at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReaderStackOverflowErrorDiag.lambda$run$0(RiverReaderStackOverflowErrorDiag.java:67)
	at …
Caused by: java.lang.IllegalStateException: Failed loading heads
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.createPlaceholderNodes(CpsFlowExecution.java:726)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.croak(CpsFlowExecution.java:931)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramFailed(CpsFlowExecution.java:919)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$2.onFailure(CpsFlowExecution.java:896)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$2.onSuccess(CpsFlowExecution.java:884)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$2.onSuccess(CpsFlowExecution.java:872)
	at org.jenkinsci.plugins.workflow.support.concurrent.Futures$1.run(Futures.java:147)
	at org.jenkinsci.plugins.workflow.support.concurrent.DirectExecutor.execute(DirectExecutor.java:33)
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1299)
	at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:763)
	at org.jenkinsci.plugins.workflow.support.concurrent.Futures.addCallback(Futures.java:157)
	at org.jenkinsci.plugins.workflow.support.concurrent.Futures.addCallback(Futures.java:97)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:869)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:836)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:718)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:582)
	at hudson.model.RunMap.retrieve(RunMap.java:273)
	at hudson.model.RunMap.retrieve(RunMap.java:65)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:703)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:685)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:579)
	at jenkins.model.lazy.LazyBuildMixIn.getBuildByNumber(LazyBuildMixIn.java:239)
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.getBuildByNumber(WorkflowJob.java:233)
	at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReaderStackOverflowErrorDiag.lambda$run$0(RiverReaderStackOverflowErrorDiag.java:65)
	... 6 more
Caused by: hudson.AbortException: Failed to load program
	... 28 more
	Suppressed: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: …
<original log redacted>
java.lang.StackOverflowError
	at java.base/jdk.internal.util.ArraysSupport.vectorizedHashCode(ArraysSupport.java:203)
	at java.base/java.lang.StringLatin1.hashCode(StringLatin1.java:191)
	at java.base/java.lang.String.hashCode(String.java:2369)
	at java.base/java.util.zip.ZipCoder.hash(ZipCoder.java:153)
	at java.base/java.util.zip.ZipFile$Source.getEntryPos(ZipFile.java:1793)
	at java.base/java.util.zip.ZipFile.getEntry(ZipFile.java:339)
	at java.base/java.util.jar.JarFile.getEntry(JarFile.java:516)
	at java.base/java.util.jar.JarFile.getJarEntry(JarFile.java:471)
	at java.base/jdk.internal.loader.URLClassPath$JarLoader.getResource(URLClassPath.java:923)
	at java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:316)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:757)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1626)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:318)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:265)
	at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1986)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1899)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1845)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1478)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:318)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:265)
	at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1986)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1899)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1845)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1478)
	at …
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1845)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1478)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:318)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:265)
	at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1986)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1899)
Also:   an exception which occurred:
	in object of type com.cloudbees.groovy.cps.impl.BlockScopeEnv
	in field com.cloudbees.groovy.cps.impl.CallEnv.caller
	in object com.cloudbees.groovy.cps.impl.ClosureCallEnv@3841485a
	in object of type com.cloudbees.groovy.cps.impl.ClosureCallEnv
	in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@238ef259
	in object of type com.cloudbees.groovy.cps.impl.BlockScopeEnv
	in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@1097a42b
	in object of type com.cloudbees.groovy.cps.impl.BlockScopeEnv
	in field com.cloudbees.groovy.cps.impl.CallEnv.caller
	in …
	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@334b4ada
	in object of type com.cloudbees.groovy.cps.impl.BlockScopeEnv
	in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@7be71a44
	in object of type com.cloudbees.groovy.cps.impl.BlockScopeEnv
	in field com.cloudbees.groovy.cps.impl.CallEnv.caller
	in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@180d8596
	in object of type com.cloudbees.groovy.cps.impl.FunctionCallEnv
	in field com.cloudbees.groovy.cps.Continuable.e
	in object org.jenkinsci.plugins.workflow.cps.SandboxContinuable@6c4b4194
	in object of type org.jenkinsci.plugins.workflow.cps.SandboxContinuable
	in field org.jenkinsci.plugins.workflow.cps.CpsThread.program
	in object org.jenkinsci.plugins.workflow.cps.CpsThread@53fcb5d
	in object of type org.jenkinsci.plugins.workflow.cps.CpsThread
	in field org.jenkinsci.plugins.workflow.cps.CpsBodyExecution.thread
	in object org.jenkinsci.plugins.workflow.cps.CpsBodyExecution@46c9c484
	in object of type org.jenkinsci.plugins.workflow.cps.CpsBodyExecution
	in element at index [1] of size [7]
	in field org.jenkinsci.plugins.workflow.cps.steps.ParallelStepExecution.bodies
	in object org.jenkinsci.plugins.workflow.cps.steps.ParallelStepExecution@23195591
	in object of type org.jenkinsci.plugins.workflow.cps.steps.ParallelStepExecution
	in field org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler.stepExecution
	in object org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler@4c5d4212
	in object of type org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler
	in field org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.handler
	in object org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback@2ab92f54
	in object of type org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback
	in element at index [0] of size [1]
	in field org.jenkinsci.plugins.workflow.cps.CpsBodyExecution.callbacks
	in object org.jenkinsci.plugins.workflow.cps.CpsBodyExecution@6c2c79b6
	in object of type org.jenkinsci.plugins.workflow.cps.CpsBodyExecution
	in field org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.this$0
	in object org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter@5f01c7f
	in object of type org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter
	in field com.cloudbees.groovy.cps.impl.CallEnv.returnAddress
	in object com.cloudbees.groovy.cps.impl.FunctionCallEnv@239b8301
	in …
	in object of type com.cloudbees.groovy.cps.impl.BlockScopeEnv
	in field com.cloudbees.groovy.cps.impl.ProxyEnv.parent
	in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@54ab8590
	in object of type com.cloudbees.groovy.cps.impl.BlockScopeEnv
	in field com.cloudbees.groovy.cps.impl.CpsClosureDef.capture
	in object com.cloudbees.groovy.cps.impl.CpsClosureDef@516cdb7e
	in object of type com.cloudbees.groovy.cps.impl.CpsClosureDef
	in field com.cloudbees.groovy.cps.impl.CpsClosure.def
	in object org.jenkinsci.plugins.workflow.cps.CpsClosure2@642a6431
	in object of type org.jenkinsci.plugins.workflow.cps.CpsClosure2
	in field groovy.lang.Closure.delegate
	in object org.jenkinsci.plugins.workflow.cps.CpsClosure2@457ce9e4
	in object of type org.jenkinsci.plugins.workflow.cps.CpsClosure2
	in field groovy.lang.Closure.delegate
	in object org.jenkinsci.plugins.workflow.cps.CpsClosure2@4df363de
	in object of type org.jenkinsci.plugins.workflow.cps.CpsClosure2
	in object of type java.util.HashMap
	in field org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.closures
	in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@7a73f635
	in object of type org.jenkinsci.plugins.workflow.cps.CpsThreadGroup
Caused: java.lang.RuntimeException
	at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:2000)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1899)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1845)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1478)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:318)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:265)
	at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1986)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1899)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1845)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1478)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:318)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:265)
	at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1986)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1899)
	at …
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1899)
	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1845)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1478)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:318)
	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:265)
Creating placeholder flownodes because failed loading originals.
  11.848 [id=73]	WARNING	o.j.p.w.f.FlowExecutionList$DefaultStorage#unregister: xxx#1 was not in the list to begin with: []
ERROR: Failed to load program
Finished: FAILURE

@jglick
Copy link
Member Author

jglick commented Feb 25, 2025

jenkinsci/pipeline-model-definition-plugin#762 is the main outcome.

@jglick jglick closed this Feb 25, 2025
@jglick jglick deleted the RiverReaderStackOverflowErrorDiag branch February 25, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant