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

Excessive calling of buildDependencyGraph can cause StackOverflow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 1.651
      template-project 1.5.2

      I get a stack overflow when trying to calculate downstream dependencies because of the recursion that happens in buildDependencyGraph on large instances.

      This is not an easy issue to reproduce because it requires a large number of upstream and downstream jobs inside of the Jenkins instance.

      It seems like a similar issue happened with the Ivy plugin here: https://issues.jenkins-ci.org/browse/JENKINS-10025

      The StackOverflow looks like:

      ```
      2017-02-22 14:45:21.410-0600 [id=133] WARNING j.u.ErrorLoggingScheduledThreadPoolExecutor#afterExecute: failure in task not wrapped in SafeTimerTask
      java.lang.StackOverflowError
      at nectar.plugins.rbac.groups.GroupContainerLocator$PersistenceHelper.getOrCreateGroupContainer(GroupContainerLocator.java:184)
      at com.cloudbees.hudson.plugins.folder.properties.FolderProxyGroupContainer$GroupContainerLocatorImpl.get(FolderProxyGroupContainer.java:230)
      at nectar.plugins.rbac.groups.GroupContainerLocator.locate(GroupContainerLocator.java:116)
      at nectar.plugins.rbac.strategy.RoleMatrixAuthorizationStrategyImpl.getACL(RoleMatrixAuthorizationStrategyImpl.java:181)
      at hudson.model.AbstractItem.getACL(AbstractItem.java:479)
      at hudson.model.AbstractItem.hasPermission(AbstractItem.java:493)
      at com.cloudbees.hudson.plugins.folder.AbstractFolder.getItem(AbstractFolder.java:1156)
      at com.cloudbees.hudson.plugins.folder.AbstractFolder.getItem(AbstractFolder.java:140)
      at jenkins.model.Jenkins.getItemByFullName(Jenkins.java:2506)
      at jenkins.model.Jenkins.getItemByFullName(Jenkins.java:2525)
      at hudson.plugins.templateproject.TemplateUtils.getProject(TemplateUtils.java:28)
      at hudson.plugins.templateproject.ProxyPublisher.getProject(ProxyPublisher.java:51)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:114)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      at hudson.plugins.templateproject.ProxyPublisher.buildDependencyGraph(ProxyPublisher.java:118)
      .....(It continues like that for a very long time)
      ```

            huybrechts huybrechts
            ataylor Alex Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: