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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-rc8
    • Fix Version/s: 2.6.9, 3.0.1, 3.1.0
    • Component/s: Diagnostics
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: