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

Method getView can cause stackOverflow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • None
    • Hudson 1.362+

      Methods getView and getPrimaryView depend on each other and this causes stackOverflow if there is no primaryView set

      public View getPrimaryView() {
              View v = getView(primaryView);
              if(v==null) // fallback
                  v = views.get(0);
              return v;
      }
      ...
       public synchronized View getView(String name) {
              for (View v : views) {
                  if(v.getViewName().equals(name))
                      return v;
              }
              // Fallback to subview of primary view if it is a ViewGroup
              View pv = getPrimaryView(); //line that causes problems
              if (pv instanceof ViewGroup)
                  return ((ViewGroup)pv).getView(name);
              return null;
      }
      

      This happens when trying to do a major upgrade like from 1.313 to 1.362+
      Exception at runtime

      javax.servlet.ServletException: Servlet execution threw an exception
      	hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      	hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      	hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
      	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      	hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      
      root cause
      
      java.lang.StackOverflowError
      	hudson.model.Hudson.getView(Hudson.java:1256)
      	hudson.model.Hudson.getPrimaryView(Hudson.java:1625)
      	hudson.model.Hudson.getView(Hudson.java:1261)
      	hudson.model.Hudson.getPrimaryView(Hudson.java:1625)
      	hudson.model.Hudson.getView(Hudson.java:1261)
      ....
      

            mindless Alan Harder
            nadirowski nadirowski
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: