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

Conditional jump or move depends on uninitialised value(s) in validate_adaptor.cpp

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.4, 4.3.3, 4.0.16, 3.6.18
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • v4.2, v4.0, v3.6
    • Execution Team 2020-01-13

      If you run db_catalog_test with valgrind memcheck, you will experience this:

      ==642003== Conditional jump or move depends on uninitialised value(s)
      ==642003==    at 0x59DC5A0: mongo::ValidateAdaptor::traverseRecordStore(mongo::OperationContext*, mongo::ValidateResults*, mongo::BSONObjBuilder*) (validate_adaptor.cpp:271)
      ==642003==    by 0x59A1704: mongo::CollectionValidation::validate(mongo::OperationContext*, mongo::NamespaceString const&, bool, bool, mongo::ValidateResults*, mongo::BSONObjBuilder*) (collection_validation.cpp:445)
      ==642003==    by 0x3AC63A: mongo::(anonymous namespace)::foregroundValidate(mongo::OperationContext*, bool, int, int, int) (collection_validation_test.cpp:100)
      ==642003==    by 0x3AD5E1: mongo::(anonymous namespace)::backgroundValidate(mongo::OperationContext*, bool, int, int, int, bool) (collection_validation_test.cpp:122)
      ==642003==    by 0x3B0146: mongo::(anonymous namespace)::UnitTest_SuiteNameBackgroundCollectionValidationTestTestNameBackgroundValidateError::_doTest() (collection_validation_test.cpp:243)
      ==642003==    by 0x6B4495C: mongo::unittest::Test::run() (unittest.cpp:205)
      ==642003==    by 0x3AFFC4: mongo::unittest::Test::RegistrationAgent<mongo::(anonymous namespace)::UnitTest_SuiteNameBackgroundCollectionValidationTestTestNameBackgroundValidateError>::RegistrationAgent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::{lambda()#1}::operator()() const (unittest.h:510)
      ==642003==    by 0x3AFE2C: std::_Function_handler<void (), mongo::unittest::Test::RegistrationAgent<mongo::(anonymous namespace)::UnitTest_SuiteNameBackgroundCollectionValidationTestTestNameBackgroundValidateError>::RegistrationAgent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (std_function.h:297)
      ==642003==    by 0x614DBDD: std::function<void ()>::operator()() const (std_function.h:687)
      ==642003==    by 0x6B45894: mongo::unittest::Suite::run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) (unittest.cpp:313)
      ==642003==    by 0x6B466B0: mongo::unittest::Suite::run(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) (unittest.cpp:374)
      ==642003==    by 0x4875B2F: main (unittest_main.cpp:102)
      ==642003==  Uninitialised value was created by a stack allocation
      ==642003==    at 0x59DBFC4: mongo::ValidateAdaptor::traverseRecordStore(mongo::OperationContext*, mongo::ValidateResults*, mongo::BSONObjBuilder*) (validate_adaptor.cpp:224)
      
      

      This appears to be because "validatedSize" is declared on the stack but not initialized.

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: