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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.4, 4.3.3, 4.0.16, 3.6.18
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2, v4.0, v3.6
    • Sprint:
      Execution Team 2020-01-13

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: