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

mongod crash on startup when passing -f on directory instead of file

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.4
    • Affects Version/s: None
    • Component/s: Admin
    • Labels:
    • Fully Compatible
    • ALL
    • Platforms 2018-07-30, Platforms 2018-08-13, Platforms 2018-08-27, Platforms 2018-09-10, Platforms 2018-09-24

      I accidentally was trying to launch a mongod (4.0.0-rc7) passing a directory instead of file and got this stack trace in return.

      mongod -f db/
      tcmalloc: large alloc 9223372036854775808 bytes == (nil) @
      2018-06-25T19:16:10.655+0000 F - [main] out of memory.
      0x7f341bef10a1 0x7f341bef06d4 0x7f341bfdfb6b 0x7f341c082564 0x7f341bdb8183 0x7f341bdaca8f 0x7f341bdb5b3c 0x7f341a542111 0x7f341a53c933 0x7f341bea42a1 0x7f341bea4b12 0x7f341a53aad7 0x7f341a4ccc69 0x7f341685bec5 0x7f341a539d4f
      ----- BEGIN BACKTRACE -----
      {"backtrace":[{"b":"7F3419AB2000","o":"243F0A1","s":"_ZN5mongo15printStackTraceERSo"},{"b":"7F3419AB2000","o":"243E6D4","s":"_ZN5mongo29reportOutOfMemoryErrorAndExitEv"},{"b":"7F3419AB2000","o":"252DB6B"},{"b":"7F3419AB2000","o":"25D0564","s":"_Znam"},{"b":"7F3419AB2000","o":"2306183","s":"_ZNSt6vectorIcSaIcEE17_M_default_appendEm"},{"b":"7F3419AB2000","o":"22FAA8F","s":"_ZN5mongo17optionenvironment13OptionsParser14readConfigFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS7_"},{"b":"7F3419AB2000","o":"2303B3C","s":"_ZN5mongo17optionenvironment13OptionsParser3runERKNS0_13OptionSectionERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EERKSt3mapISB_SB_St4lessISB_ESaISt4pairIKSB_SB_EEEPNS0_11EnvironmentE"},{"b":"7F3419AB2000","o":"A90111","s":"_ZN5mongo17optionenvironment46_mongoInitializerFunction_StartupOptions_ParseEPNS_18InitializerContextE"},{"b":"7F3419AB2000","o":"A8A933","s":"_ZNSt17_Function_handlerIFN5mongo6StatusEPNS0_18InitializerContextEEPS4_E9_M_invokeERKSt9_Any_dataOS3_"},{"b":"7F3419AB2000","o":"23F22A1","s":"_ZN5mongo11Initializer19executeInitializersERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EERKSt3mapIS7_S7_St4lessIS7_ESaISt4pairIKS7_S7_EEE"},{"b":"7F3419AB2000","o":"23F2B12","s":"_ZN5mongo21runGlobalInitializersEiPKPKcS3_"},{"b":"7F3419AB2000","o":"A88AD7","s":"_ZN5mongo11mongoDbMainEiPPcS1_"},{"b":"7F3419AB2000","o":"A1AC69","s":"main"},{"b":"7F341683A000","o":"21EC5","s":"__libc_start_main"},{"b":"7F3419AB2000","o":"A87D4F"}]}
      mongod(_ZN5mongo15printStackTraceERSo+0x41) [0x7f341bef10a1]
      mongod(_ZN5mongo29reportOutOfMemoryErrorAndExitEv+0x84) [0x7f341bef06d4]
      mongod(+0x252DB6B) [0x7f341bfdfb6b]
      mongod(_Znam+0x224) [0x7f341c082564]
      mongod(_ZNSt6vectorIcSaIcEE17_M_default_appendEm+0x83) [0x7f341bdb8183]
      mongod(_ZN5mongo17optionenvironment13OptionsParser14readConfigFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS7_+0x25F) [0x7f341bdaca8f]
      mongod(_ZN5mongo17optionenvironment13OptionsParser3runERKNS0_13OptionSectionERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EERKSt3mapISB_SB_St4lessISB_ESaISt4pairIKSB_SB_EEEPNS0_11EnvironmentE+0x163C) [0x7f341bdb5b3c]
      mongod(_ZN5mongo17optionenvironment46_mongoInitializerFunction_StartupOptions_ParseEPNS_18InitializerContextE+0x51) [0x7f341a542111]
      mongod(_ZNSt17_Function_handlerIFN5mongo6StatusEPNS0_18InitializerContextEEPS4_E9_M_invokeERKSt9_Any_dataOS3_+0x23) [0x7f341a53c933]
      mongod(_ZN5mongo11Initializer19executeInitializersERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EERKSt3mapIS7_S7_St4lessIS7_ESaISt4pairIKS7_S7_EEE+0x371) [0x7f341bea42a1]
      mongod(_ZN5mongo21runGlobalInitializersEiPKPKcS3_+0x352) [0x7f341bea4b12]
      mongod(_ZN5mongo11mongoDbMainEiPPcS1_+0xA7) [0x7f341a53aad7]
      mongod(main+0x9) [0x7f341a4ccc69]
      libc.so.6(__libc_start_main+0xF5) [0x7f341685bec5]
      mongod(+0xA87D4F) [0x7f341a539d4f]
      ----- END BACKTRACE -----
      

      This was caused by pilot error, nevertheless `mongod` probably should not error out this way.

            Assignee:
            annie.black@mongodb.com Annie Black
            Reporter:
            norberto.leite Norberto Fernando Rocha Leite (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            151 Start watching this issue

              Created:
              Updated:
              Resolved: