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

mongos dbStats does not handle large values for scale

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Execution Team 2021-08-23
    • 52

      This was reported by our UBSAN builder when a fuzzer test passed a large value for the scale option to the dbStats command on a shard:

      See SERVER-56689 for a similar fix in the mongos collStats command.

      [j0:s] src/mongo/bson/bsonelement.h:974:25: runtime error: 9.22337e+18 is outside the range of representable values of type 'int'
       
      [j0:s]     #0 0x55b214ad80c9 in mongo::BSONElement::numberInt() const /data/mci/d72e3e8444b63d0a440661d740da8ad6/src/src/mongo/bson/bsonelement.h:974:25
      [j0:s]     #1 0x55b214af547c in mongo::(anonymous namespace)::DBStatsCmd::errmsgRun(mongo::OperationContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, mongo::BSONObjBuilder&) /data/mci/d72e3e8444b63d0a440661d740da8ad6/src/src/mongo/s/commands/cluster_db_stats_cmd.cpp:117:37
      

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: