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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.0.0-rc8
    • 2.6.9, 3.0.1, 3.1.0
    • Diagnostics
    • Fully Compatible
    • ALL

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: