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

key_string_test forms invalid integer negation

    • Fully Compatible
    • ALL
    • Hide

      Run key_string_test under UBSAN

      Show
      Run key_string_test under UBSAN
    • Platforms 13 (04/22/16)

      See https://github.com/mongodb/mongo/blob/bd2c33b3c6000b92aa42bd285654d8e27bcd3af7/src/mongo/db/storage/key_string_test.cpp#L246

      This results in the following error under UBSAN:

      rc/mongo/db/storage/key_string_test.cpp:246:9: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
          #0 0x59d660 in UnitTest__KeyStringTest__LotsOfNumbers1::_doTest() /home/andrew/Documents/10gen/dev/src/mongodb/src/mongo/db/storage/key_string_test.cpp:246:9
          #1 0x61c208 in mongo::unittest::Test::run() /home/andrew/Documents/10gen/dev/src/mongodb/src/mongo/unittest/unittest.cpp:147:9
          #2 0x5c5933 in void mongo::unittest::Suite::runTestObject<UnitTest__KeyStringTest__LotsOfNumbers1>() /home/andrew/Documents/10gen/dev/src/mongodb/src/mongo/unittest/unittest.h:405:9
          #3 0x61d99d in mongo::unittest::TestHolder::run() const /home/andrew/Documents/10gen/dev/src/mongodb/src/mongo/unittest/unittest.h:257:9
          #4 0x61d99d in mongo::unittest::Suite::run(std::string const&, int) /home/andrew/Documents/10gen/dev/src/mongodb/src/mongo/unittest/unittest.cpp:263
          #5 0x61ee67 in mongo::unittest::Suite::run(std::vector<std::string, std::allocator<std::string> > const&, std::string const&, int) /home/andrew/Documents/10gen/dev/src/mongodb/src/mongo/unittest/unittest.cpp:321:27
          #6 0x6244a7 in main /home/andrew/Documents/10gen/dev/src/mongodb/src/mongo/unittest/unittest_main.cpp:40:12
          #7 0x7faa2b62ba3f in __libc_start_main /build/buildd/glibc-2.21/csu/libc-start.c:289
          #8 0x56b9e8 in _start (/home/andrew/Documents/10gen/dev/src/mongodb/build/optdebug/mongo/db/storage/storage_key_string_test+0x56b9e8)
      

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: