==18555==ERROR: AddressSanitizer: heap-use-after-free on address 0x621004670aa8 at pc 0x0000007ab125 bp 0x7ffdecaecd20 sp 0x7ffdecaecd10 READ of size 4 at 0x621004670aa8 thread T0 #0 0x7ab124 in dwarf2_frame_this_id /home/smarchi/src/binutils-gdb/gdb/dwarf2/frame.c:1228 #1 0x983ec5 in compute_frame_id /home/smarchi/src/binutils-gdb/gdb/frame.c:550 #2 0x9841ee in get_frame_id(frame_info*) /home/smarchi/src/binutils-gdb/gdb/frame.c:582 #3 0x1093faa in scoped_restore_current_thread::scoped_restore_current_thread() /home/smarchi/src/binutils-gdb/gdb/thread.c:1462 #4 0xaee5ba in fetch_inferior_event(void*) /home/smarchi/src/binutils-gdb/gdb/infrun.c:3968 #5 0xaa990b in inferior_event_handler(inferior_event_type, void*) /home/smarchi/src/binutils-gdb/gdb/inf-loop.c:43 #6 0xea61b6 in remote_async_serial_handler /home/smarchi/src/binutils-gdb/gdb/remote.c:14161 #7 0xefca8a in run_async_handler_and_reschedule /home/smarchi/src/binutils-gdb/gdb/ser-base.c:137 #8 0xefcd23 in fd_event /home/smarchi/src/binutils-gdb/gdb/ser-base.c:188 #9 0x15a7416 in handle_file_event /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:548 #10 0x15a7c36 in gdb_wait_for_event /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:673 #11 0x15a5dbb in gdb_do_one_event() /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:215 #12 0xbfe62d in start_event_loop /home/smarchi/src/binutils-gdb/gdb/main.c:356 #13 0xbfe935 in captured_command_loop /home/smarchi/src/binutils-gdb/gdb/main.c:416 #14 0xc01d39 in captured_main /home/smarchi/src/binutils-gdb/gdb/main.c:1253 #15 0xc01dc9 in gdb_main(captured_main_args*) /home/smarchi/src/binutils-gdb/gdb/main.c:1268 #16 0x414ddd in main /home/smarchi/src/binutils-gdb/gdb/gdb.c:32 #17 0x7f590110b82f in __libc_start_main ../csu/libc-start.c:291 #18 0x414bd8 in _start (/home/smarchi/build/binutils-gdb/gdb/gdb+0x414bd8) 0x621004670aa8 is located 424 bytes inside of 4064-byte region [0x621004670900,0x6210046718e0) freed by thread T0 here: #0 0x7f5903c42c7f in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10bc7f) #1 0x98fb0c in xfree /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/common-utils.h:62 #2 0x160804b in call_freefun /home/smarchi/src/binutils-gdb/libiberty/obstack.c:103 #3 0x1608a72 in _obstack_free /home/smarchi/src/binutils-gdb/libiberty/obstack.c:280 #4 0x98af3b in reinit_frame_cache() /home/smarchi/src/binutils-gdb/gdb/frame.c:1864 #5 0x109341c in switch_to_no_thread() /home/smarchi/src/binutils-gdb/gdb/thread.c:1301 #6 0xad0cf2 in switch_to_inferior_no_thread(inferior*) /home/smarchi/src/binutils-gdb/gdb/inferior.c:612 #7 0xe76c9f in remote_unpush_target /home/smarchi/src/binutils-gdb/gdb/remote.c:5521 #8 0xe8d997 in remote_target::readchar(int) /home/smarchi/src/binutils-gdb/gdb/remote.c:9138 #9 0xe90082 in remote_target::getpkt_or_notif_sane_1(std::vector > >*, int, int, int*) /home/smarchi/src/binutils-gdb/gdb/remote.c:9684 #10 0xe90adc in remote_target::getpkt_sane(std::vector > >*, int) /home/smarchi/src/binutils-gdb/gdb/remote.c:9791 #11 0xe8fe58 in remote_target::getpkt(std::vector > >*, int) /home/smarchi/src/binutils-gdb/gdb/remote.c:9624 #12 0xe8c4b6 in remote_target::remote_read_bytes_1(unsigned long, unsigned char*, unsigned long, int, unsigned long*) /home/smarchi/src/binutils-gdb/gdb/remote.c:8861 #13 0xe8cd1f in remote_target::remote_read_bytes(unsigned long, unsigned char*, unsigned long, int, unsigned long*) /home/smarchi/src/binutils-gdb/gdb/remote.c:8988 #14 0xe96134 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:10988 #15 0x104a76f 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 #16 0x104b65c 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:1148 #17 0x104c4b0 in target_read_partial /home/smarchi/src/binutils-gdb/gdb/target.c:1379 #18 0x104c68e in target_read(target_ops*, target_object, char const*, unsigned char*, unsigned long, long) /home/smarchi/src/binutils-gdb/gdb/target.c:1419 #19 0x104bd7a in target_read_raw_memory(unsigned long, unsigned char*, long) /home/smarchi/src/binutils-gdb/gdb/target.c:1252 #20 0x761b32 in dcache_read_line /home/smarchi/src/binutils-gdb/gdb/dcache.c:336 #21 0x761ebf in dcache_peek_byte /home/smarchi/src/binutils-gdb/gdb/dcache.c:403 #22 0x76244d in dcache_read_memory_partial(target_ops*, dcache_struct*, unsigned long, unsigned char*, unsigned long, unsigned long*) /home/smarchi/src/binutils-gdb/gdb/dcache.c:484 #23 0x104ae00 in memory_xfer_partial_1 /home/smarchi/src/binutils-gdb/gdb/target.c:1033 #24 0x104b03d in memory_xfer_partial /home/smarchi/src/binutils-gdb/gdb/target.c:1076 #25 0x104b5c7 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 #26 0x11e85c3 in read_value_memory(value*, long, int, unsigned long, unsigned char*, unsigned long) /home/smarchi/src/binutils-gdb/gdb/valops.c:956 #27 0x121eb88 in value_fetch_lazy_memory /home/smarchi/src/binutils-gdb/gdb/value.c:3764 #28 0x121fa89 in value_fetch_lazy(value*) /home/smarchi/src/binutils-gdb/gdb/value.c:3910 #29 0x1214bcc in value_optimized_out(value*) /home/smarchi/src/binutils-gdb/gdb/value.c:1411 previously allocated by thread T0 here: #0 0x7f5903c43078 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10c078) #1 0x4a1c73 in xmalloc /home/smarchi/src/binutils-gdb/gdb/alloc.c:60 #2 0x1607f59 in call_chunkfun /home/smarchi/src/binutils-gdb/libiberty/obstack.c:94 #3 0x1608104 in _obstack_begin_worker /home/smarchi/src/binutils-gdb/libiberty/obstack.c:141 #4 0x16083b7 in _obstack_begin /home/smarchi/src/binutils-gdb/libiberty/obstack.c:164 #5 0x98af5a in reinit_frame_cache() /home/smarchi/src/binutils-gdb/gdb/frame.c:1865 #6 0x109348a in switch_to_thread(thread_info*) /home/smarchi/src/binutils-gdb/gdb/thread.c:1316 #7 0xad0ed4 in inferior_command /home/smarchi/src/binutils-gdb/gdb/inferior.c:636 #8 0x6524e3 in do_const_cfunc /home/smarchi/src/binutils-gdb/gdb/cli/cli-decode.c:95 #9 0x65ae7c in cmd_func(cmd_list_element*, char const*, int) /home/smarchi/src/binutils-gdb/gdb/cli/cli-decode.c:2187 #10 0x10a85fd in execute_command(char const*, int) /home/smarchi/src/binutils-gdb/gdb/top.c:668 #11 0x94bb32 in command_handler(char const*) /home/smarchi/src/binutils-gdb/gdb/event-top.c:588 #12 0x94c436 in command_line_handler(std::unique_ptr >&&) /home/smarchi/src/binutils-gdb/gdb/event-top.c:773 #13 0x94a716 in gdb_rl_callback_handler /home/smarchi/src/binutils-gdb/gdb/event-top.c:219 #14 0x12afe46 in rl_callback_read_char /home/smarchi/src/binutils-gdb/readline/readline/callback.c:281 #15 0x94a28a in gdb_rl_callback_read_char_wrapper_noexcept /home/smarchi/src/binutils-gdb/gdb/event-top.c:177 #16 0x94a488 in gdb_rl_callback_read_char_wrapper /home/smarchi/src/binutils-gdb/gdb/event-top.c:194 #17 0x94b6e1 in stdin_event_handler(int, void*) /home/smarchi/src/binutils-gdb/gdb/event-top.c:516 #18 0x15a7416 in handle_file_event /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:548 #19 0x15a7c36 in gdb_wait_for_event /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:673 #20 0x15a5dbb in gdb_do_one_event() /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:215 #21 0xbfe62d in start_event_loop /home/smarchi/src/binutils-gdb/gdb/main.c:356 #22 0xbfe935 in captured_command_loop /home/smarchi/src/binutils-gdb/gdb/main.c:416 #23 0xc01d39 in captured_main /home/smarchi/src/binutils-gdb/gdb/main.c:1253 #24 0xc01dc9 in gdb_main(captured_main_args*) /home/smarchi/src/binutils-gdb/gdb/main.c:1268 #25 0x414ddd in main /home/smarchi/src/binutils-gdb/gdb/gdb.c:32 #26 0x7f590110b82f in __libc_start_main ../csu/libc-start.c:291