[tich@localhost lib]$ gdb ./a.out GNU gdb (GDB) Fedora 7.12.1-47.fc25 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./a.out...done. (gdb) b __sanitizer::Die Function "__sanitizer::Die" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (__sanitizer::Die) pending. (gdb) r Starting program: /home/tich/python/lib/a.out [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7ffff2dff700 (LWP 6534)] Done ==6530==ERROR: AddressSanitizer failed to deallocate 0x2000 (8192) bytes at address 0x625000005100 ==6530==AddressSanitizer CHECK failed: ../../../../libsanitizer/sanitizer_common/sanitizer_posix.cc:131 "(("unable to unmap" && 0)) != (0)" (0x0, 0x0) #0 0x7ffff6f057aa (/lib64/libasan.so.3+0xd07aa) #1 0x7ffff6f0c163 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/lib64/libasan.so.3+0xd7163) #2 0x7ffff6f1641f (/lib64/libasan.so.3+0xe141f) #3 0x7ffff6f17230 (/lib64/libasan.so.3+0xe2230) #4 0x7ffff6f09768 (/lib64/libasan.so.3+0xd4768) #5 0x7ffff5668438 in __nptl_deallocate_tsd.part.4 (/lib64/libpthread.so.0+0x6438) #6 0x7ffff5669877 in start_thread (/lib64/libpthread.so.0+0x7877) #7 0x7ffff5d93f7e in clone (/lib64/libc.so.6+0x107f7e) [Switching to Thread 0x7ffff2dff700 (LWP 6534)] Thread 2 "a.out" hit Breakpoint 1, __sanitizer::Die () at ../../../../libsanitizer/sanitizer_common/sanitizer_common.cc:137 137 void NORETURN Die() { (gdb) p __asan_describe_address(0x625000005100) 0x625000005100 is located 0 bytes inside of 8192-byte region [0x625000005100,0x625000007100) freed by thread T1 here: #0 0x7ffff6efbb00 in free (/lib64/libasan.so.3+0xc6b00) #1 0x7ffff6b06198 in _PyFaulthandler_Fini Modules/faulthandler.c:1383 #2 0x7ffff6a94edd in Py_FinalizeEx Python/pylifecycle.c:650 #3 0x40126f in do_it() /home/tich/sandbox/main.cpp:10 #4 0x401d36 in void std::_Bind_simple::_M_invoke<>(std::_Index_tuple<>) /usr/include/c++/6.3.1/functional:1391 #5 0x401cb6 in std::_Bind_simple::operator()() /usr/include/c++/6.3.1/functional:1380 #6 0x401c95 in std::thread::_State_impl >::_M_run() /usr/include/c++/6.3.1/thread:196 #7 0x7ffff662d5ce (/lib64/libstdc++.so.6+0xbb5ce) #8 0x7ffff56696c9 in start_thread (/lib64/libpthread.so.0+0x76c9) #9 0x7ffff5d93f7e in clone (/lib64/libc.so.6+0x107f7e) previously allocated by thread T1 here: #0 0x7ffff6efbe60 in malloc (/lib64/libasan.so.3+0xc6e60) #1 0x7ffff69e2c87 in _PyObject_Alloc Objects/obmalloc.c:1427 #2 0x7ffff69e2c87 in _PyObject_Malloc Objects/obmalloc.c:1437 #3 0x7ffff6b05dd4 in _PyFaulthandler_Init Modules/faulthandler.c:1319 #4 0x7ffff6a95f7c in _Py_InitializeEx_Private Python/pylifecycle.c:441 #5 0x40124e in do_it() /home/tich/sandbox/main.cpp:8 #6 0x401d36 in void std::_Bind_simple::_M_invoke<>(std::_Index_tuple<>) /usr/include/c++/6.3.1/functional:1391 #7 0x401cb6 in std::_Bind_simple::operator()() /usr/include/c++/6.3.1/functional:1380 #8 0x401c95 in std::thread::_State_impl >::_M_run() /usr/include/c++/6.3.1/thread:196 #9 0x7ffff662d5ce (/lib64/libstdc++.so.6+0xbb5ce) #10 0x7ffff56696c9 in start_thread (/lib64/libpthread.so.0+0x76c9) #11 0x7ffff5d93f7e in clone (/lib64/libc.so.6+0x107f7e) Thread T1 created by T0 here: #0 0x7ffff6e66488 in __interceptor_pthread_create (/lib64/libasan.so.3+0x31488) #1 0x7ffff662d8e4 in std::thread::_M_start_thread(std::unique_ptr >, void (*)()) (/lib64/libstdc++.so.6+0xbb8e4) #2 0x40130f in main /home/tich/sandbox/main.cpp:15 #3 0x7ffff5cac400 in __libc_start_main (/lib64/libc.so.6+0x20400) $1 = void (gdb) info threads Id Target Id Frame 1 Thread 0x7ffff7fdd780 (LWP 6530) "a.out" 0x00007ffff566a96d in pthread_join (threadid=140737268152064, thread_return=0x0) at pthread_join.c:90 * 2 Thread 0x7ffff2dff700 (LWP 6534) "a.out" __sanitizer::Die () at ../../../../libsanitizer/sanitizer_common/sanitizer_common.cc:137 (gdb) bt #0 __sanitizer::Die () at ../../../../libsanitizer/sanitizer_common/sanitizer_common.cc:137 #1 0x00007ffff6f05816 in __asan::AsanCheckFailed (file=, line=, cond=, v1=, v2=) at ../../../../libsanitizer/asan/asan_rtl.cc:66 #2 0x00007ffff6f0c164 in __sanitizer::CheckFailed (file=file@entry=0x7ffff6f428e8 "../../../../libsanitizer/sanitizer_common/sanitizer_posix.cc", line=line@entry=131, cond=cond@entry=0x7ffff6f428c0 "((\"unable to unmap\" && 0)) != (0)", v1=v1@entry=0, v2=v2@entry=0) at ../../../../libsanitizer/sanitizer_common/sanitizer_common.cc:157 #3 0x00007ffff6f16420 in __sanitizer::UnmapOrDie (addr=0x625000005100, size=8192) at ../../../../libsanitizer/sanitizer_common/sanitizer_posix.cc:131 #4 0x00007ffff6f17231 in __sanitizer::UnsetAlternateSignalStack () at ../../../../libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:163 #5 0x00007ffff6f09769 in __asan::AsanThread::Destroy (this=0x7ffff7f7f000) at ../../../../libsanitizer/asan/asan_thread.cc:108 #6 0x00007ffff5668439 in __nptl_deallocate_tsd () at pthread_create.c:175 #7 0x00007ffff5669878 in __nptl_deallocate_tsd () at pthread_create.c:326 #8 start_thread (arg=0x7ffff2dff700) at pthread_create.c:346 #9 0x00007ffff5d93f7f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105 (gdb)