From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3159C3858428; Mon, 4 Sep 2023 14:05:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3159C3858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693836323; bh=w57ao77ajZvG4GQtPgC/DjHuajpgtdxuNuA0g4FtS3I=; h=From:To:Subject:Date:From; b=vhaQL24RM0fy4dQD2W5ctQb0/tuJ+csjhvR0tnKBM67gGlhkxKqE8clHN01llIYYW tnAeYWAby1mw3TslYBfLSDcb1FNGN+eXcp8F97Wm0j9kaZBBbjI+go7v64dbXvfIYj D1injGo8NpW/p7xDzIfdQdLDY2IuyQNdiO8NwHZo= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tui/30823] New: [gdb/tui] segfault in tui_find_disassembly_address Date: Mon, 04 Sep 2023 14:05:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tui X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30823 Bug ID: 30823 Summary: [gdb/tui] segfault in tui_find_disassembly_address Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: tui Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I was walking through outputs/gdb.threads/next-fork-other-thread/next-fork-other-thread-fork (bui= ld with target board unix/-m32), using TUI layout asm, first setting a breakpo= int at fork and the running, then doing nexti a lot when hitting the breakpoint= s in the various threads. I ran into a segfault: ... (gdb) bt #0 0x00007fe36c6ad76b in raise () from /lib64/libpthread.so.0 #1 0x000000000078ed99 in handle_fatal_signal (sig=3D11) at /data/vries/gdb/src/gdb/event-top.c:912 #2 0x000000000078ee21 in handle_sigsegv (sig=3D11) at /data/vries/gdb/src/gdb/event-top.c:962 #3 #4 0x0000000000c5e7a4 in tui_find_disassembly_address (gdbarch=3D0x45110a0, pc=3D4158011920, from=3D-6) at /data/vries/gdb/src/gdb/tui/tui-disasm.c:247 #5 0x0000000000c5f0c3 in tui_get_low_disassembly_address (gdbarch=3D0x4511= 0a0, low=3D4158011920,=20 pc=3D4158011920) at /data/vries/gdb/src/gdb/tui/tui-disasm.c:439 #6 0x0000000000c5f32e in tui_disasm_window::maybe_update (this=3D0x42ecdb0, fi=3D..., sal=3D...) at /data/vries/gdb/src/gdb/tui/tui-disasm.c:500 #7 0x0000000000c7fc83 in tui_show_frame_info (fi=3D...) at /data/vries/gdb/src/gdb/tui/tui-stack.c:284 #8 0x0000000000c6140f in tui_refresh_frame_and_register_information () at /data/vries/gdb/src/gdb/tui/tui-hooks.c:136 #9 0x0000000000c61618 in tui_before_prompt ( current_gdb_prompt=3D0x293ced0 "(gdb) ") at /data/vries/gdb/src/gdb/tui/tui-hooks.c:185 #10 0x0000000000797fa5 in std::_Function_handler::_M_invoke(std::_Any_data const&, char const*&&) (__functor=3D...,=20 __args#0=3D@0x7fffc6b93e00: 0x293ced0 "(gdb) ") at /usr/include/c++/7/bits/std_function.h:316 #11 0x000000000078fcc1 in std::function::operator()(char const*) const ( this=3D0x4950e10, __args#0=3D0x293ced0 "(gdb) ") at /usr/include/c++/7/bits/std_function.h:706 #12 0x000000000078fa96 in gdb::observers::observable::notify ( this=3D0x2938560 , args#0=3D0x293ced0 "(gdb) ") at /data/vries/gdb/src/gdb/../gdbsupport/observable.h:166 #13 0x000000000078e20d in top_level_prompt () at /data/vries/gdb/src/gdb/event-top.c:474 #14 0x000000000078e110 in display_gdb_prompt (new_prompt=3D0x0) at /data/vries/gdb/src/gdb/event-top.c:441 #15 0x00000000005fe6c8 in cli_interp_base::on_sync_execution_done (this=3D0x43ddfc0) at /data/vries/gdb/src/gdb/cli/cli-interp.c:149 #16 0x000000000085cb32 in check_curr_ui_sync_execution_done () at /data/vries/gdb/src/gdb/infrun.c:4285 #17 0x000000000085cb6e in all_uis_check_sync_execution_done () at /data/vries/gdb/src/gdb/infrun.c:4297 #18 0x000000000085d334 in fetch_inferior_event () at /data/vries/gdb/src/gdb/infrun.c:4563 #19 0x000000000083ace6 in inferior_event_handler (event_type=3DINF_REG_EVEN= T) at /data/vries/gdb/src/gdb/inf-loop.c:42 #20 0x000000000086b136 in infrun_async_inferior_event_handler (data=3D0x0) at /data/vries/gdb/src/gdb/infrun.c:9836 #21 0x000000000052ad74 in check_async_event_handlers () at /data/vries/gdb/src/gdb/async-event.c:338 #22 0x000000000149b938 in gdb_do_one_event (mstimeout=3D-1) at /data/vries/gdb/src/gdbsupport/event-loop.cc:221 #23 0x00000000008f5d37 in start_event_loop () at /data/vries/gdb/src/gdb/main.c:412 #24 0x00000000008f5e91 in captured_command_loop () at /data/vries/gdb/src/gdb/main.c:476 #25 0x00000000008f767d in captured_main (data=3D0x7fffc6b94540) at /data/vries/gdb/src/gdb/main.c:1320 #26 0x00000000008f7717 in gdb_main (args=3D0x7fffc6b94540) at /data/vries/gdb/src/gdb/main.c:1339 #27 0x0000000000415f53 in main (argc=3D10, argv=3D0x7fffc6b94658) at /data/vries/gdb/src/gdb/gdb.c:39 (gdb)=20 ... The problem seems to be here: ... (gdb) down #4 0x0000000000c5e7a4 in tui_find_disassembly_address (gdbarch=3D0x45110a0, pc=3D4158011920, from=3D-6) at /data/vries/gdb/src/gdb/tui/tui-disasm.c:247 247 last_addr =3D asm_lines.back ().addr; (gdb) p asm_lines.back () You can't do that without a process to debug. (gdb) p asm_lines $3 =3D { >> = =3D { _M_impl =3D {> =3D {<__gnu_cxx::new_allocator> =3D {}, }, _M_start =3D 0x0, _M_finish =3D 0x0,=20 _M_end_of_storage =3D 0x0}}, } ... --=20 You are receiving this mail because: You are on the CC list for the bug.=