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

JavaScript RangeError: Maximum recursion depth exceeded

    • Icon: Bug Bug
    • Resolution: Postponed
    • Icon: Critical Critical
    • other
    • None
    • Windows XP, Hudson 1.355, Opera 10.53
      Fedora 12, Hudson 1.343 with HUDSON-6424 patch, Opera 10.60
      Windows 7 64-bit, Opera 10.63, Hudson 1.382

      When trying to edit an simple Job with 4 windows batch scripts, I get the error "JavaScript RangeError: Maximum recursion depth exceeded" when running Hudson with Opera 10.53.

      The error happens, when I try to add another windows batch script. The error is easy reproducable, the content of the batch scripts are not even important. I even got it with such simple scripts as cls (script 1), echo 1 (script 2), echo 2 (script 3), echo 3 (script 4).

      After an pop-up with the error message "JavaScript RangeError: Maximum recursion depth exceeded", I get the following error message:

      {{Status Code: 500
      Exception:
      Stacktrace:
      net.sf.json.JSONException: A JSONObject text must begin with '

      {' at character 1 of init at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:512) at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:839) at net.sf.json.JSONObject._fromString(JSONObject.java:1060) at net.sf.json.JSONObject.fromObject(JSONObject.java:176) at net.sf.json.JSONObject.fromObject(JSONObject.java:147) at org.kohsuke.stapler.RequestImpl.getSubmittedForm(RequestImpl.java:711) at hudson.model.Job.doConfigSubmit(Job.java:1026) at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:555) at sun.reflect.GeneratedMethodAccessor429.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:169) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:101) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:54) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:75) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:519) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:181) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:519) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:435) at org.kohsuke.stapler.Stapler.service(Stapler.java:123) at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) at winstone.ServletConfiguration.execute(ServletConfiguration.java:249) at winstone.RequestDispatcher.forward(RequestDispatcher.java:335) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:330) at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:31) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:97) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at winstone.RequestDispatcher.forward(RequestDispatcher.java:333) at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244) at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150) at java.lang.Thread.run(Unknown Source)}

      }

          [JENKINS-6424] JavaScript RangeError: Maximum recursion depth exceeded

          bl_80 created issue -

          Alan Harder added a comment -

          please clear all browser caches to ensure the latest javascript is used.. do you still see an error? If so, please check the error console for any javascript errors and post them here. The "500" error is expected, as a javascript problem will cause invalid form data to be submitted.

          Alan Harder added a comment - please clear all browser caches to ensure the latest javascript is used.. do you still see an error? If so, please check the error console for any javascript errors and post them here. The "500" error is expected, as a javascript problem will cause invalid form data to be submitted.

          bl_80 added a comment -

          I get no JavaScript errors in the error console. Clearing the browser cache didn't change anything, the error still occurs.

          bl_80 added a comment - I get no JavaScript errors in the error console. Clearing the browser cache didn't change anything, the error still occurs.

          Alan Harder added a comment -

          Looks like Hudson's form processing javascript exceeds some new limit in Opera.
          According to this thread it is only a problem since Opera 10.52, so you might try downgrading to 10.51.

          Alan Harder added a comment - Looks like Hudson's form processing javascript exceeds some new limit in Opera. According to this thread it is only a problem since Opera 10.52, so you might try downgrading to 10.51.

          Alan Harder added a comment -

          dug a little further.. it's the Object.toJSON(form.formDom) call in buildFormTree that triggers the error. This function is defined in prototype.js

          Alan Harder added a comment - dug a little further.. it's the Object.toJSON(form.formDom) call in buildFormTree that triggers the error. This function is defined in prototype.js

          Alan Harder added a comment -

          Object.toJSON defined in prototype.js has this line:
          if (object.toJSON) return object.toJSON();

          For some reason, Opera 10.53 (and 10.52 too, according to the above linked forum post) can sometimes get false here when the toJSON function is actually defined on the object. Even stranger, simply rechecking the exact same attribute again seems to then return true.

          if (object.toJSON || object.toJSON) return object.toJSON();

          This works!?

          Alan Harder added a comment - Object.toJSON defined in prototype.js has this line: if (object.toJSON) return object.toJSON(); For some reason, Opera 10.53 (and 10.52 too, according to the above linked forum post) can sometimes get false here when the toJSON function is actually defined on the object. Even stranger, simply rechecking the exact same attribute again seems to then return true. if (object.toJSON || object.toJSON) return object.toJSON(); This works!?
          Alan Harder made changes -
          Assignee New: Alan Harder [ mindless ]
          Alan Harder made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Alan Harder added a comment -

          typeof(object.toJSON) exhibits the same behavior. The first call gets undefined and the next call gets function, even when both of these calls are after 2 references to object.toJSON in boolean contexts.

          Alan Harder added a comment - typeof(object.toJSON) exhibits the same behavior. The first call gets undefined and the next call gets function , even when both of these calls are after 2 references to object.toJSON in boolean contexts.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/war/resources/scripts/prototype.js
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/30716
          Log:
          [FIXED JENKINS-6424] Add workaround for Opera 10.52/53 bug causing
          error in saving job configuration.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/war/resources/scripts/prototype.js trunk/www/changelog.html http://jenkins-ci.org/commit/30716 Log: [FIXED JENKINS-6424] Add workaround for Opera 10.52/53 bug causing error in saving job configuration.

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

              Created:
              Updated:
              Resolved: