https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88750
--- Comment #22 from Jürgen Reuter <juergen.reuter at desy dot de> --- This is the output from the lldb command (but this was not a debug build of gcc yet): $ lldb ./static_1.exe (lldb) target create "./static_1.exe" Current executable set to './static_1.exe' (x86_64). (lldb) run Process 36799 launched: './static_1.exe' (x86_64) static_1.exe(36799,0x1048f75c0) malloc: *** error for object 0x105c5eee0: pointer being freed was not allocated static_1.exe(36799,0x1048f75c0) malloc: *** set a breakpoint in malloc_error_break to debug Process 36799 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x00007fff5a2d023e libsystem_kernel.dylib`__pthread_kill + 10 libsystem_kernel.dylib`__pthread_kill: -> 0x7fff5a2d023e <+10>: jae 0x7fff5a2d0248 ; <+20> 0x7fff5a2d0240 <+12>: movq %rax, %rdi 0x7fff5a2d0243 <+15>: jmp 0x7fff5a2ca3b7 ; cerror_nocancel 0x7fff5a2d0248 <+20>: retq Target 0: (static_1.exe) stopped. (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT * frame #0: 0x00007fff5a2d023e libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x00007fff5a386c1c libsystem_pthread.dylib`pthread_kill + 285 frame #2: 0x00007fff5a2391c9 libsystem_c.dylib`abort + 127 frame #3: 0x00007fff5a3486e2 libsystem_malloc.dylib`malloc_vreport + 545 frame #4: 0x00007fff5a3484a3 libsystem_malloc.dylib`malloc_report + 152 frame #5: 0x0000000100929c84 static_1.exe`std::locale::_Impl::~_Impl(this=0x0000000105c5f0a0) at locale.cc:243 frame #6: 0x0000000100929d8e static_1.exe`std::locale::operator=(this=0x0000000105c611c0, __other=0x00007ffeefbfdad8) at locale_classes.h:568 frame #7: 0x0000000100927aec static_1.exe`std::ios_base::_M_init(this=0x0000000105c610f0) at ios_locale.cc:44 frame #8: 0x000000010096cef1 static_1.exe`std::basic_ios<char, std::char_traits<char> >::init(this=0x0000000105c610f0, __sb=0x0000000105c60840) at basic_ios.tcc:129 frame #9: 0x0000000105afcdf9 libstdc++.6.dylib`std::ios_base::Init::Init() + 681 frame #10: 0x0000000105ad30a0 libsio.2.12.dylib`_GLOBAL__sub_I_SIO_blockManager.cc + 16 frame #11: 0x0000000104859cc8 dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 518 frame #12: 0x0000000104859ec6 dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40 frame #13: 0x00000001048550da dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 358 frame #14: 0x000000010485506d dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 249 frame #15: 0x000000010485506d dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 249 frame #16: 0x0000000104854254 dyld`ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 134 frame #17: 0x00000001048542e8 dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 74 frame #18: 0x0000000104843774 dyld`dyld::initializeMainExecutable() + 199 frame #19: 0x000000010484878f dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 6237 frame #20: 0x00000001048424f6 dyld`dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 1154 frame #21: 0x0000000104842036 dyld`_dyld_start + 54