LLVM Discussion Forums

Llvm_shutdown calls to new?

Hello, I have recently upgraded an disassembler project from my company based on LLVM version 3.3 to LLVM 10.0. I made the necessary changes to the project, I can see that it disassembles correctly what I give him, but now I see reports of memory leaks which trace back to llvm_shutdown. I looked around in the sources for it but I don`t see how it would ever make a call to new. I attached the stack trace. I get 2 memory leaks with the same stack trace when I run any of my tests which use the disassembler. Does anyone know how this would happen?

ntdll.dll!RtlAllocateHeap 00007ffc3833b7f0
ucrtbased.dll!calloc_base + 0x1220 bytes 00007ffbc35a23a0
ucrtbased.dll!calloc_base + 0xfc8 bytes 00007ffbc35a2148
ucrtbased.dll!malloc_dbg + 0x2a bytes 00007ffbc35a520a
ucrtbased.dll!malloc + 0x19 bytes 00007ffbc35a5c69
disassembler.arm.TEST.exe!operator new Line 35 + 0x5 bytes 00007ff6231e7b2e
disassembler.arm.TEST.exe!llvm::llvm_shutdown + 0x8a bytes 00007ff62306627a
disassembler.arm.TEST.exe!??$_Call@A6AXXZ$$V@_Invoker_functor@std@@SAXA6AXXZ@Z + 0x28 bytes 00007ff623066658
disassembler.arm.TEST.exe!??$invoke@A6AXXZ$$V@std@@YAXA6AXXZ@Z + 0x2b bytes 00007ff6230669cb
disassembler.arm.TEST.exe!??$_Invoke_stored_explicit@A6AXXZAEAVexception_ptr@std@@$$Z$0A@@std@@YAX$$QEAV?$tuple@A6AXXZAEAVexception_ptr@std@@@0@U?$integer_sequence@_K$0A@@0@@Z + 0x37 bytes 00007ff623066767
disassembler.arm.TEST.exe!std::_Callback_once<std::tuple<void (__cdecl&)(void),std::exception_ptr & __ptr64>,std::integer_sequence<unsigned __int64,0>,1> + 0x4b bytes 00007ff6230666bb
ntdll.dll!RtlRunOnceExecuteOnce + 0x89 bytes 00007ffc3830b059
KERNELBASE.dll!InitOnceExecuteOnce + 0x5 bytes 00007ffc35cc20b5
MSVCP140D.dll!_crtInitOnceExecuteOnce + 0x75 bytes 00007ffbdc8c7365
MSVCP140D.dll!std::_Execute_once + 0x28 bytes 00007ffbdc8bf158
disassembler.arm.TEST.exe!??$call_once@A6AXXZ$$V@std@@YAXAEAUonce_flag@0@A6AXXZ@Z + 0x78 bytes 00007ff623066868
disassembler.arm.TEST.exe!??$call_once@A6AXXZ$$V@llvm@@YAXAEAUonce_flag@std@@A6AXXZ@Z + 0x35 bytes 00007ff6230667d5
disassembler.arm.TEST.exe!llvm::llvm_shutdown + 0xf3 bytes 00007ff6230662e3
disassembler.arm.TEST.exe!llvm::ManagedStaticBase::RegisterManagedStatic + 0x5c bytes 00007ff623065fcc
disassembler.arm.TEST.exe!llvm::ManagedStatic<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,llvm::object_creator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,llvm::object_deleter<std::basic_string<char,std::char_traits<char>,std::al + 0x4d bytes 00007ff62316460d
disassembler.arm.TEST.exe!llvm::CreateInfoOutputFile + 0x1ec bytes 00007ff62315c23c
disassembler.arm.TEST.exe!boost::system::`dynamic initializer for 'throws'' + 0x18a78 bytes 00007ff622913998
ucrtbased.dll!initterm + 0x53 bytes 00007ffbc35c4a43
disassembler.arm.TEST.exe!__scrt_common_main_seh Line 256 + 0xe bytes 00007ff6231e9484
disassembler.arm.TEST.exe!__scrt_common_main Line 330 00007ff6231e93e9
disassembler.arm.TEST.exe!mainCRTStartup Line 16 00007ff6231e96d4
KERNEL32.DLL!BaseThreadInitThunk + 0xe bytes 00007ffc37377bce
ntdll.dll!RtlUserThreadStart + 0x1b bytes 00007ffc3836ce4b