Overriding the Error object causes infinite recursion

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 3.3.1
    • Component/s: JavaScript
    • None
    • Fully Compatible
    • ALL
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Running the following code on OS X triggers a InternalError: too much recursion. But on Ubuntu the recursion does not terminate and the process is killed in a few minutes for consuming too much memory.

      Error = assert.doesNotThrow;
      assert.commandWorked(0);
      

      stacktrace on OS X; on Ubuntu it's the same minus the last line:

      assert: threw unexpected exception: TypeError: func.apply is not a function : undefined
      assert: threw unexpected exception: TypeError: func.apply is not a function : undefined
      assert: threw unexpected exception: TypeError: func.apply is not a function : undefined
      assert: threw unexpected exception: TypeError: func.apply is not a function : undefined
      ...... (roughly 880 lines on OS X)
      2016-02-16T14:59:49.917-0500 E QUERY    [thread1] warning: log line attempted (78kB) over max size (10kB), printing beginning and end ... InternalError: too much recursion :
      

      ulimit -s is 8192 for both OSes.

              Assignee:
              DO NOT USE - Backlog - Platform Team
              Reporter:
              Robert Guo (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: