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

StackOverflowError from UpstreamCause.onLoad

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      I had a test project

      <?xml version='1.0' encoding='UTF-8'?>
      <project>
        <actions/>
        <description></description>
        <keepDependencies>false</keepDependencies>
        <properties/>
        <scm class="hudson.scm.NullSCM"/>
        <canRoam>true</canRoam>
        <disabled>false</disabled>
        <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
        <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
        <triggers/>
        <concurrentBuild>false</concurrentBuild>
        <builders/>
        <publishers>
          <hudson.tasks.BuildTrigger>
            <childProjects>p</childProjects>
            <threshold>
              <name>SUCCESS</name>
              <ordinal>0</ordinal>
              <color>BLUE</color>
              <completeBuild>true</completeBuild>
            </threshold>
          </hudson.tasks.BuildTrigger>
        </publishers>
        <buildWrappers/>
      </project>
      

      which in a previous session had created ~1000 builds:

      <?xml version='1.0' encoding='UTF-8'?>
      <build>
        <actions>
          <hudson.model.CauseAction>
            <causes>
              <hudson.model.Cause_-UpstreamCause>
                <upstreamProject>p</upstreamProject>
                <upstreamUrl>job/p/</upstreamUrl>
                <upstreamBuild>385</upstreamBuild>
                <upstreamCauses>
                  <hudson.model.Cause_-UpstreamCause>
                    <upstreamProject>p</upstreamProject>
                    <upstreamUrl>job/p/</upstreamUrl>
                    <upstreamBuild>384</upstreamBuild>
                    <upstreamCauses>
                      ...
                                                            <upstreamBuild>374</upstreamBuild>
                                                            <upstreamCauses>
                                                              <hudson.model.Cause_-UpstreamCause_-DeeplyNestedUpstreamCause/>
                ...
            </causes>
          </hudson.model.CauseAction>
        </actions>
        <number>386</number>
        ...
      </build>
      

      After restarting Jenkins, startup was broken by numerous errors:

      Aug 07, 2014 3:18:59 PM hudson.model.RunMap retrieve
      WARNING: could not load .../jobs/p/builds/385
      java.io.IOException: Unable to read .../p/builds/2014-07-31_10-35-45/build.xml
      	at hudson.XmlFile.unmarshal(XmlFile.java:167)
      	at hudson.model.Run.reload(Run.java:323)
      	at hudson.model.Run.<init>(Run.java:311)
      	at hudson.model.AbstractBuild.<init>(AbstractBuild.java:177)
      	at hudson.model.Build.<init>(Build.java:103)
      	at hudson.model.FreeStyleBuild.<init>(FreeStyleBuild.java:38)
      	at sun.reflect.GeneratedConstructorAccessor52.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      	at jenkins.model.lazy.LazyBuildMixIn.loadBuild(LazyBuildMixIn.java:155)
      	at jenkins.model.lazy.LazyBuildMixIn$1.create(LazyBuildMixIn.java:136)
      	at hudson.model.RunMap.retrieve(RunMap.java:218)
      	at hudson.model.RunMap.retrieve(RunMap.java:56)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:688)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:650)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:382)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:547)
      	at jenkins.model.lazy.LazyBuildMixIn.getBuildByNumber(LazyBuildMixIn.java:235)
      	at hudson.model.AbstractProject.getBuildByNumber(AbstractProject.java:957)
      	at hudson.model.AbstractProject.getBuildByNumber(AbstractProject.java:145)
      	at hudson.model.Cause$UpstreamCause.onLoad(Cause.java:190)
      	at hudson.model.CauseAction.onLoad(CauseAction.java:124)
      	at hudson.model.Run.onLoad(Run.java:342)
      	at hudson.model.RunMap.retrieve(RunMap.java:219)
      	at hudson.model.RunMap.retrieve(RunMap.java:56)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:688)
      	at ...
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:650)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:382)
      Caused by: java.lang.StackOverflowError
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.FieldAliasingMapper.realMember(FieldAliasingMapper.java:66)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.OuterClassMapper.realMember(OuterClassMapper.java:44)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.AnnotationMapper.realMember(AnnotationMapper.java:123)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at com.thoughtworks.xstream.mapper.AnnotationMapper.realMember(AnnotationMapper.java:123)
      	at hudson.util.xstream.MapperDelegate.realMember(MapperDelegate.java:51)
      	at com.thoughtworks.xstream.mapper.MapperWrapper.realMember(MapperWrapper.java:38)
      	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:272)
      	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:228)
      	at hudson.util.XStream2$PassthruConverter.unmarshal(XStream2.java:392)
      	at hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:362)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
      	at hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:83)
      	at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:80)
      	at hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:74)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      	at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:349)
      	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:289)
      	at ...
      	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:228)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
      	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
      	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
      	at hudson.util.XStream2.unmarshal(XStream2.java:113)
      	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
      	at hudson.XmlFile.unmarshal(XmlFile.java:163)
      	at hudson.model.Run.reload(Run.java:323)
      	at hudson.model.Run.<init>(Run.java:311)
      	at hudson.model.AbstractBuild.<init>(AbstractBuild.java:177)
      	at hudson.model.Build.<init>(Build.java:103)
      	at hudson.model.FreeStyleBuild.<init>(FreeStyleBuild.java:38)
      	at sun.reflect.GeneratedConstructorAccessor52.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      	at jenkins.model.lazy.LazyBuildMixIn.loadBuild(LazyBuildMixIn.java:155)
      	at jenkins.model.lazy.LazyBuildMixIn$1.create(LazyBuildMixIn.java:136)
      	at hudson.model.RunMap.retrieve(RunMap.java:218)
      	at hudson.model.RunMap.retrieve(RunMap.java:56)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:688)
      	at ...
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:382)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:547)
      	at jenkins.model.lazy.LazyBuildMixIn.getBuildByNumber(LazyBuildMixIn.java:235)
      	at hudson.model.AbstractProject.getBuildByNumber(AbstractProject.java:957)
      	at hudson.model.AbstractProject.getBuildByNumber(AbstractProject.java:145)
      	at hudson.model.Cause$UpstreamCause.onLoad(Cause.java:190)
      	at hudson.model.CauseAction.onLoad(CauseAction.java:124)
      	at hudson.model.Run.onLoad(Run.java:342)
      	at hudson.model.RunMap.retrieve(RunMap.java:219)
      	at hudson.model.RunMap.retrieve(RunMap.java:56)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:688)
      

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            JENKINS-14814 fix bounds the size of any one build record, but onLoad bypasses this by loading earlier build record, each with one earlier cause prior to the bound.

            Show
            jglick Jesse Glick added a comment - JENKINS-14814 fix bounds the size of any one build record, but onLoad bypasses this by loading earlier build record, each with one earlier cause prior to the bound.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/hudson/model/Cause.java
            http://jenkins-ci.org/commit/jenkins/479dfb404677772a26eecc21d9f82af9e8ce71c2
            Log:
            [FIXED JENKINS-24161] Break recursion in UpstreamCause.onLoad.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/Cause.java http://jenkins-ci.org/commit/jenkins/479dfb404677772a26eecc21d9f82af9e8ce71c2 Log: [FIXED JENKINS-24161] Break recursion in UpstreamCause.onLoad.
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3588
            [FIXED JENKINS-24161] Break recursion in UpstreamCause.onLoad. (Revision 479dfb404677772a26eecc21d9f82af9e8ce71c2)

            Result = SUCCESS
            Jesse Glick : 479dfb404677772a26eecc21d9f82af9e8ce71c2
            Files :

            • changelog.html
            • core/src/main/java/hudson/model/Cause.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3588 [FIXED JENKINS-24161] Break recursion in UpstreamCause.onLoad. (Revision 479dfb404677772a26eecc21d9f82af9e8ce71c2) Result = SUCCESS Jesse Glick : 479dfb404677772a26eecc21d9f82af9e8ce71c2 Files : changelog.html core/src/main/java/hudson/model/Cause.java

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: