This was reported by our UBSAN builder when a fuzzer test passed a large value for the skip option to the count command on a shard:
src/mongo/bson/bsonelement.h:1101:31: runtime error: 1.84467e+19 is outside the range of representable values of type 'long long' [j0:s] #0 0x560ada7a7bec in mongo::BSONElement::numberLong() const /data/mci/b434ec9678edb7336db65615df0d242f/src/src/mongo/bson/bsonelement.h:1101:31 [j0:s] #1 0x560ada9c31f0 in mongo::(anonymous namespace)::ClusterCountCmd::applySkipLimit(long long, mongo::BSONObj const&) /data/mci/b434ec9678edb7336db65615df0d242f/src/src/mongo/s/commands/cluster_count_cmd.cpp:287:27 [j0:s] #2 0x560ada9c208a in mongo::(anonymous namespace)::ClusterCountCmd::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/b434ec9678edb7336db65615df0d242f/src/src/mongo/s/commands/cluster_count_cmd.cpp:188:17 [j0:s] #3 0x560adbd95bff in mongo::ErrmsgCommandDeprecated::run(mongo::OperationContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::BSONObj const&, mongo::BSONObjBuilder&) /data/mci/b434ec9678edb7336db65615df0d242f/src/src/mongo/db/commands.cpp:1054:15
See SERVER-59189 for a similar fix in the mongos dbStats command.
- is related to
-
SERVER-59189 mongos dbStats does not handle large values for scale
- Closed