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

tcmalloc cleanup can cause access violation after returning from main() on Windows debug.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.11
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Dev Tools 2019-04-22
    • 41

      Reproducing and creating a full dump using Windows Error Reporting gave the following call stack (no other threads were doing anything):

       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!std::ctype<char>::widen(char) Line 2566	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!std::basic_ios<char,std::char_traits<char> >::widen(char) Line 125	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!std::basic_ios<char,std::char_traits<char> >::init(std::basic_streambuf<char,std::char_traits<char> > *) Line 167	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!std::basic_ostream<char,std::char_traits<char> >::basic_ostream<char,std::char_traits<char> >(std::basic_streambuf<char,std::char_traits<char> > * _Strbuf, bool _Isstd) Line 54	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!std::basic_ostringstream<char,std::char_traits<char>,std::allocator<char> >::{ctor}(int) Line 568	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!std::make_unique() Line 2539	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!mongo::logger::LogstreamBuilder::makeStream() Line 123	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!mongo::logger::LogstreamBuilder::stream() Line 113	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!mongo::logger::LogstreamBuilder::operator<<(const char *) Line 118	C++
      >	storage_wiredtiger_prefixed_record_store_test.exe!mongo::`anonymous namespace'::exceptionFilter(_EXCEPTION_POINTERS * excPointers) Line 138	C++
       	KERNELBASE.dll!UnhandledExceptionFilter()	Unknown
       	ntdll.dll!RtlUserThreadStart$filt$0()	Unknown
       	ntdll.dll!__C_specific_handler()	Unknown
       	ntdll.dll!RtlpExecuteHandlerForException()	Unknown
       	ntdll.dll!RtlDispatchException()	Unknown
       	ntdll.dll!KiUserExceptionDispatch()	Unknown
       	ntdll.dll!RtlpWaitOnCriticalSection()	Unknown
       	ntdll.dll!RtlpEnterCriticalSectionContended()	Unknown
       	ntdll.dll!RtlEnterCriticalSection()	Unknown
       	storage_wiredtiger_prefixed_record_store_test.exe!_Mtxlock(_RTL_CRITICAL_SECTION * _Mtx) Line 24	C
       	storage_wiredtiger_prefixed_record_store_test.exe!std::_Lockit::_Lockit(int kind) Line 69	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!std::_Iterator_base12::_Adopt(const std::_Container_base12 * _Parent) Line 162	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!std::_Iterator_base12::operator=(const std::_Iterator_base12 &) Line 131	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!std::_Iterator_base12::{ctor}(const std::_Iterator_base12 &) Line 115	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::Span::ExtractSpanSetIterator() Line 142	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::PageHeap::RemoveFromFreeList(tcmalloc::Span * span) Line 435	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::PageHeap::CheckAndHandlePreMerge(tcmalloc::Span * span, tcmalloc::Span * other) Line 341	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::PageHeap::MergeIntoFreeList(tcmalloc::Span * span) Line 384	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::PageHeap::Delete(tcmalloc::Span * span) Line 314	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::CentralFreeList::ReleaseToSpans(void *) Line 142	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::CentralFreeList::ReleaseListToSpans(void * start) Line 85	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::CentralFreeList::InsertRange(void * start, void * end, int N) Line 243	C++
       	[Inline Frame] storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::ThreadCache::ReleaseToCentralCache(tcmalloc::ThreadCache::FreeList * src, unsigned int N, int) Line 207	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::ThreadCache::Cleanup() Line 110	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!tcmalloc::ThreadCache::DeleteCache(tcmalloc::ThreadCache * heap) Line 473	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!on_process_term() Line 138	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!_initterm(void(*)() * first, void(*)() * last) Line 22	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!common_exit::__l2::<lambda>() Line 251	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!__crt_seh_guarded_call<void>::operator()<void <lambda>(void),void <lambda>(void) & __ptr64,void <lambda>(void) >(__acrt_lock_and_call::__l2::void <lambda>(void) && setup, common_exit::__l2::void <lambda>(void) & action, __acrt_lock_and_call::__l2::void <lambda>(void) && cleanup) Line 224	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!__acrt_lock_and_call<void <lambda>(void) >(const __acrt_lock_id lock_id, common_exit::__l2::void <lambda>(void) && action) Line 961	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!common_exit(const int return_code, const _crt_exit_cleanup_mode cleanup_mode, const _crt_exit_return_mode return_mode) Line 259	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!exit(int return_code) Line 294	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!__scrt_common_main_seh() Line 297	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!__scrt_common_main() Line 331	C++
       	storage_wiredtiger_prefixed_record_store_test.exe!mainCRTStartup() Line 17	C++
       	kernel32.dll!BaseThreadInitThunk()	Unknown
       	ntdll.dll!RtlUserThreadStart()	Unknown
      

            Assignee:
            henrik.edin@mongodb.com Henrik Edin
            Reporter:
            henrik.edin@mongodb.com Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: