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

Aggregating deeply-nested documents can cause stack overflow

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • v3.4
    • 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

              kyle.suarez@mongodb.com Kyle Suarez
              rassi J Rassi
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: