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

'top' command with 64MB result document can terminate server

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.9, 3.0.1, 3.1.0
    • Affects Version/s: 3.0.0-rc8
    • Component/s: Diagnostics
    • Fully Compatible
    • ALL

      A top command that produces a document that is ~64MB can terminate the server. See top.cpp below (and SERVER-7459 and SERVER-17224)

      db/stats/top.cpp

      197    virtual bool run(OperationContext* txn, const string&, BSONObj& cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
      198    {
      199        BSONObjBuilder b( result.subobjStart( "totals" ) );
      200        b.append( "note", "all times in microseconds" );
      

      If b.append throws, the destructor for b will call BSONObjBuilder::_done. _done will throw an exception if result is 64MB because it will attempt to grow to accommodate EOO, which pushes it past the internal 64MB limit.

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: