==4074==ERROR: AddressSanitizer: heap-use-after-free on address 0x621004a4fdf8 at pc 0x0000009810b3 bp 0x7fff38bbca90 sp 0x7fff38bbca80 WRITE of size 8 at 0x621004a4fdf8 thread T0 #0 0x9810b2 in frame_unwind_try_unwinder /home/smarchi/src/binutils-gdb/gdb/frame-unwind.c:134 #1 0x98126c in frame_unwind_find_by_frame(frame_info*, void**) /home/smarchi/src/binutils-gdb/gdb/frame-unwind.c:186 #2 0x983c9c in compute_frame_id /home/smarchi/src/binutils-gdb/gdb/frame.c:546 #3 0x984166 in get_frame_id(frame_info*) /home/smarchi/src/binutils-gdb/gdb/frame.c:582 #4 0x1098eee in restore_selected_frame /home/smarchi/src/binutils-gdb/gdb/thread.c:1355 #5 0x10992f7 in scoped_restore_current_thread::restore() /home/smarchi/src/binutils-gdb/gdb/thread.c:1411 #6 0x1099354 in scoped_restore_current_thread::~scoped_restore_current_thread() /home/smarchi/src/binutils-gdb/gdb/thread.c:1420 #7 0xaeab83 in do_target_wait /home/smarchi/src/binutils-gdb/gdb/infrun.c:3670 #8 0xaecbe2 in fetch_inferior_event() /home/smarchi/src/binutils-gdb/gdb/infrun.c:3965 #9 0xaa8096 in inferior_event_handler(inferior_event_type) /home/smarchi/src/binutils-gdb/gdb/inf-loop.c:42 #10 0xeab8b6 in remote_async_inferior_event_handler /home/smarchi/src/binutils-gdb/gdb/remote.c:14166 #11 0x4ca10f in check_async_event_handlers() /home/smarchi/src/binutils-gdb/gdb/async-event.c:295 #12 0x15bef40 in gdb_do_one_event() /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:194 #13 0xbfd50d in start_event_loop /home/smarchi/src/binutils-gdb/gdb/main.c:356 #14 0xbfd815 in captured_command_loop /home/smarchi/src/binutils-gdb/gdb/main.c:416 #15 0xc00c24 in captured_main /home/smarchi/src/binutils-gdb/gdb/main.c:1253 #16 0xc00cb4 in gdb_main(captured_main_args*) /home/smarchi/src/binutils-gdb/gdb/main.c:1268 #17 0x414d9d in main /home/smarchi/src/binutils-gdb/gdb/gdb.c:32 #18 0x7fc78984e83f in __libc_start_main ../csu/libc-start.c:291 #19 0x414b98 in _start (/home/smarchi/build/binutils-gdb/gdb/gdb+0x414b98) 0x621004a4fdf8 is located 248 bytes inside of 4064-byte region [0x621004a4fd00,0x621004a50ce0) freed by thread T0 here: #0 0x7fc78c385c7f in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bc7f) #1 0x98f9f6 in xfree /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/common-utils.h:62 #2 0x162625f in call_freefun /home/smarchi/src/binutils-gdb/libiberty/obstack.c:103 #3 0x1626c86 in _obstack_free /home/smarchi/src/binutils-gdb/libiberty/obstack.c:280 #4 0x98ae25 in reinit_frame_cache() /home/smarchi/src/binutils-gdb/gdb/frame.c:1856 #5 0x1098ade in switch_to_no_thread() /home/smarchi/src/binutils-gdb/gdb/thread.c:1301 #6 0xacf543 in switch_to_inferior_no_thread(inferior*) /home/smarchi/src/binutils-gdb/gdb/inferior.c:626 #7 0xe7c38b in remote_unpush_target /home/smarchi/src/binutils-gdb/gdb/remote.c:5521 #8 0xe92db5 in unpush_and_perror /home/smarchi/src/binutils-gdb/gdb/remote.c:9101 #9 0xe930c6 in remote_target::readchar(int) /home/smarchi/src/binutils-gdb/gdb/remote.c:9141 #10 0xe9576e in remote_target::getpkt_or_notif_sane_1(std::vector > >*, int, int, int*) /home/smarchi/src/binutils-gdb/gdb/remote.c:9683 #11 0xe961c8 in remote_target::getpkt_sane(std::vector > >*, int) /home/smarchi/src/binutils-gdb/gdb/remote.c:9790 #12 0xe95544 in remote_target::getpkt(std::vector > >*, int) /home/smarchi/src/binutils-gdb/gdb/remote.c:9623 #13 0xe91ba2 in remote_target::remote_read_bytes_1(unsigned long, unsigned char*, unsigned long, int, unsigned long*) /home/smarchi/src/binutils-gdb/gdb/remote.c:8860 #14 0xe9240b in remote_target::remote_read_bytes(unsigned long, unsigned char*, unsigned long, int, unsigned long*) /home/smarchi/src/binutils-gdb/gdb/remote.c:8987 #15 0xe9b820 in remote_target::xfer_partial(target_object, char const*, unsigned char*, unsigned char const*, unsigned long, unsigned long, unsigned long*) /home/smarchi/src/binutils-gdb/gdb/remote.c:10987 #16 0x104fd39 in raw_memory_xfer_partial(target_ops*, unsigned char*, unsigned char const*, unsigned long, long, unsigned long*) /home/smarchi/src/binutils-gdb/gdb/target.c:918 #17 0x1050424 in memory_xfer_partial_1 /home/smarchi/src/binutils-gdb/gdb/target.c:1047 #18 0x1050607 in memory_xfer_partial /home/smarchi/src/binutils-gdb/gdb/target.c:1076 #19 0x1050b91 in target_xfer_partial(target_ops*, target_object, char const*, unsigned char*, unsigned char const*, unsigned long, unsigned long, unsigned long*) /home/smarchi/src/binutils-gdb/gdb/target.c:1133 #20 0x1051a7a in target_read_partial /home/smarchi/src/binutils-gdb/gdb/target.c:1379 #21 0x1051c58 in target_read(target_ops*, target_object, char const*, unsigned char*, unsigned long, long) /home/smarchi/src/binutils-gdb/gdb/target.c:1419 #22 0x1051177 in target_read_memory(unsigned long, unsigned char*, long) /home/smarchi/src/binutils-gdb/gdb/target.c:1222 #23 0x4b4730 in amd64_stack_frame_destroyed_p /home/smarchi/src/binutils-gdb/gdb/amd64-tdep.c:2909 #24 0x4b4821 in amd64_epilogue_frame_sniffer /home/smarchi/src/binutils-gdb/gdb/amd64-tdep.c:2924 #25 0x981047 in frame_unwind_try_unwinder /home/smarchi/src/binutils-gdb/gdb/frame-unwind.c:128 #26 0x98126c in frame_unwind_find_by_frame(frame_info*, void**) /home/smarchi/src/binutils-gdb/gdb/frame-unwind.c:186 #27 0x983c9c in compute_frame_id /home/smarchi/src/binutils-gdb/gdb/frame.c:546 #28 0x984166 in get_frame_id(frame_info*) /home/smarchi/src/binutils-gdb/gdb/frame.c:582 #29 0x1098eee in restore_selected_frame /home/smarchi/src/binutils-gdb/gdb/thread.c:1355 previously allocated by thread T0 here: #0 0x7fc78c386078 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10c078) #1 0x4a1ad3 in xmalloc /home/smarchi/src/binutils-gdb/gdb/alloc.c:60 #2 0x162616d in call_chunkfun /home/smarchi/src/binutils-gdb/libiberty/obstack.c:94 #3 0x1626318 in _obstack_begin_worker /home/smarchi/src/binutils-gdb/libiberty/obstack.c:141 #4 0x16265cb in _obstack_begin /home/smarchi/src/binutils-gdb/libiberty/obstack.c:164 #5 0x98ae44 in reinit_frame_cache() /home/smarchi/src/binutils-gdb/gdb/frame.c:1857 #6 0x1098b4c in switch_to_thread(thread_info*) /home/smarchi/src/binutils-gdb/gdb/thread.c:1316 #7 0x1099146 in scoped_restore_current_thread::restore() /home/smarchi/src/binutils-gdb/gdb/thread.c:1399 #8 0x1099354 in scoped_restore_current_thread::~scoped_restore_current_thread() /home/smarchi/src/binutils-gdb/gdb/thread.c:1420 #9 0xaeab83 in do_target_wait /home/smarchi/src/binutils-gdb/gdb/infrun.c:3670 #10 0xaecbe2 in fetch_inferior_event() /home/smarchi/src/binutils-gdb/gdb/infrun.c:3965 #11 0xaa8096 in inferior_event_handler(inferior_event_type) /home/smarchi/src/binutils-gdb/gdb/inf-loop.c:42 #12 0xeab8b6 in remote_async_inferior_event_handler /home/smarchi/src/binutils-gdb/gdb/remote.c:14166 #13 0x4ca10f in check_async_event_handlers() /home/smarchi/src/binutils-gdb/gdb/async-event.c:295 #14 0x15bef40 in gdb_do_one_event() /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:194 #15 0xbfd50d in start_event_loop /home/smarchi/src/binutils-gdb/gdb/main.c:356 #16 0xbfd815 in captured_command_loop /home/smarchi/src/binutils-gdb/gdb/main.c:416 #17 0xc00c24 in captured_main /home/smarchi/src/binutils-gdb/gdb/main.c:1253 #18 0xc00cb4 in gdb_main(captured_main_args*) /home/smarchi/src/binutils-gdb/gdb/main.c:1268 #19 0x414d9d in main /home/smarchi/src/binutils-gdb/gdb/gdb.c:32 #20 0x7fc78984e83f in __libc_start_main ../csu/libc-start.c:291 SUMMARY: AddressSanitizer: heap-use-after-free /home/smarchi/src/binutils-gdb/gdb/frame-unwind.c:134 in frame_unwind_try_unwinder Shadow bytes around the buggy address: 0x0c4280941f60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4280941f70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4280941f80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4280941f90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4280941fa0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c4280941fb0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd[fd] 0x0c4280941fc0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4280941fd0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4280941fe0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4280941ff0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4280942000: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==4074==ABORTING