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

mongo SSL shell crashes on process exit on Windows 2008 R2

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc5, 3.7.1
    • Affects Version/s: 3.6.0-rc4
    • Component/s: Shell
    • None
    • Fully Compatible
    • ALL
    • v3.6
    • Platforms 2017-12-04

      On Windows quickExit calls ExitProcess which allows windows to terminate TLS initializers which is not desirable. quickExit should call TerminateProcess instead. It repros on Windows 2008R2, not Windows 10. It only appears to affect 3.6.0-rc0+ builds.

      Crash:

      e94.c98): Access violation - code c0000005 (first chance)
      First chance exceptions are reported before any exception handling.
      This exception may be expected and handled.
      *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\system32\ucrtbase.DLL - 
      ntdll!RtlAllocateHeap+0x3d:
      00000000`77a3dc9d 8b4174          mov     eax,dword ptr [rcx+74h] ds:00000000`00000074=????????
      0:000> k
      Child-SP          RetAddr           Call Site
      00000000`001cf470 000007fe`ee114121 ntdll!RtlAllocateHeap+0x3d
      *** WARNING: Unable to verify checksum for mongo.exe
      00000000`001cf580 00000001`40462a85 ucrtbase!malloc+0x31
      00000000`001cf5b0 00000001`3fd32654 mongo!operator new+0x31 [f:\dd\vctools\crt\vcstartup\src\heap\new_scalar.cpp @ 19]
      (Inline Function) --------`-------- mongo!std::_Allocate+0x70 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 @ 83]
      00000000`001cf5e0 00000001`4033e0db mongo!std::allocator<mongo::ProcessId>::allocate+0x74 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 @ 725]
      (Inline Function) --------`-------- mongo!std::_Wrap_alloc<std::allocator<unsigned long> >::allocate+0x5 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 @ 976]
      00000000`001cf610 00000001`40346f31 mongo!std::vector<unsigned long,std::allocator<unsigned long> >::_Reallocate+0x2b [c:\program files (x86)\microsoft visual studio 14.0\vc\include\vector @ 1602]
      (Inline Function) --------`-------- mongo!std::vector<unsigned long,std::allocator<unsigned long> >::push_back+0x64 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\vector @ 1290]
      (Inline Function) --------`-------- mongo!std::stack<unsigned long,std::vector<unsigned long,std::allocator<unsigned long> > >::push+0x64 [c:\program files (x86)\microsoft visual studio 14.0\vc\include\stack @ 140]
      00000000`001cf660 00000001`404b58af mongo!mongo::`anonymous namespace'::SSLThreadInfo::ThreadIDManager::releaseID+0xa1 [c:\data\mci\dc858632b33a197d526b517d1e79b170\src\src\mongo\util\net\ssl_manager.cpp @ 321]
      (Inline Function) --------`-------- mongo!mongo::`anonymous-namespace'::SSLThreadInfo::getID::__l2::CallErrRemoveState::{dtor}+0x13 [c:\data\mci\dc858632b33a197d526b517d1e79b170\src\src\mongo\util\net\ssl_manager.cpp @ 263]
      (Inline Function) --------`-------- mongo!boost::optional_detail::optional_base<`mongo::`anonymous namespace'::SSLThreadInfo::getID'::`2'::CallErrRemoveState>::destroy_impl+0x13 [c:\data\mci\dc858632b33a197d526b517d1e79b170\src\src\third_party\boost-1.60.0\boost\optional\optional.hpp @ 745]
      (Inline Function) --------`-------- mongo!boost::optional_detail::optional_base<`mongo::`anonymous namespace'::SSLThreadInfo::getID'::`2'::CallErrRemoveState>::destroy+0x18 [c:\data\mci\dc858632b33a197d526b517d1e79b170\src\src\third_party\boost-1.60.0\boost\optional\optional.hpp @ 707]
      (Inline Function) --------`-------- mongo!boost::optional_detail::optional_base<`mongo::`anonymous namespace'::SSLThreadInfo::getID'::`2'::CallErrRemoveState>::{dtor}+0x18 [c:\data\mci\dc858632b33a197d526b517d1e79b170\src\src\third_party\boost-1.60.0\boost\optional\optional.hpp @ 327]
      (Inline Function) --------`-------- mongo!boost::optional<`mongo::`anonymous namespace'::SSLThreadInfo::getID'::`2'::CallErrRemoveState>::{dtor}+0x18 [c:\data\mci\dc858632b33a197d526b517d1e79b170\src\src\third_party\boost-1.60.0\boost\optional\optional.hpp @ 877]
      00000000`001cf6b0 00000001`40463767 mongo!`mongo::`anonymous namespace'::SSLThreadInfo::getID'::`2'::`dynamic atexit destructor for 'threadLocalState''+0x3f
      00000000`001cf6f0 00000000`77a513f7 mongo!__dyn_tls_dtor+0x67 [f:\dd\vctools\crt\vcstartup\src\tls\tlsdtor.cpp @ 119]
      00000000`001cf730 00000000`77a4f963 ntdll!RtlIsDosDeviceName_U+0xd6d7
      00000000`001cf7a0 00000000`77a128d0 ntdll!RtlIsDosDeviceName_U+0xbc43
      00000000`001cf8c0 00000001`4040ee7e ntdll!RtlExitUserProcess+0x90
      00000000`001cf8f0 00000001`3fd28c5f mongo!mongo::quickExit+0x2e [c:\data\mci\dc858632b33a197d526b517d1e79b170\src\src\mongo\util\quick_exit.cpp @ 106]
      00000000`001cf920 00000001`40463a6d mongo!wmain+0x4f [c:\data\mci\dc858632b33a197d526b517d1e79b170\src\src\mongo\shell\dbshell.cpp @ 1075]
      *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\system32\kernel32.dll - 
      (Inline Function) --------`-------- mongo!invoke_main+0x22 [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 79]
      00000000`001cf970 00000000`778e59cd mongo!__scrt_common_main_seh+0x11d [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 253]
      00000000`001cf9b0 00000000`77a1a561 kernel32!BaseThreadInitThunk+0xd
      00000000`001cf9e0 00000000`00000000 ntdll!RtlUserThreadStart+0x21
      

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: