Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8433

Aggregating deeply-nested documents can cause stack overflow

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Backport Requested:
      v3.4
    • Sprint:
      Query 2017-01-23, Query 2017-02-13, Query 2017-03-27

      Description

      Recursive calls made to mongo::Document::toBson, in mongo/db/pipeline/document.cpp.

      To reproduce (on my OS X 10.8 machine, triggers if levels >= 811):

      function makeNestObj(depth){
          toret = {s : 1};
          for(i = 1; i < depth; i++){
              toret = {s : toret};
          }
          return toret;
      }
      db.foo.insert(makeNestObj(levels));
      db.foo.aggregate({$project:{s:1}})
      

      (snippet above borrowed from SERVER-6462)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: