From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E513C382A1B7; Thu, 17 Nov 2022 16:41:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E513C382A1B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668703287; bh=JVGetfd9lR1yQjTBgQmgJ5/GnwXBWgS4se0O/13MIPU=; h=From:To:Subject:Date:From; b=yy7UPf1il3Tham2I4z4Nu5n0blghfKclKWaOX7IRqes5JKbS8gHWnV5hPaUENEKQH eUtkcZXhAHMA8T29RB2qvfss7F6rW8yc2ZdBhKRfHH25kwkki0Y/QTwFcPNyLEoqyw V+uAnyrCy7hhvBVi4hmgRSccbykTGy3Q/pSZam4U= From: "hp at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug cli/29800] New: Trying to "document" an undefined command causes crash Date: Thu, 17 Nov 2022 16:41:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hp at sourceware dot 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=3D29800 Bug ID: 29800 Summary: Trying to "document" an undefined command causes crash Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: cli Assignee: unassigned at sourceware dot org Reporter: hp at sourceware dot org Target Milestone: --- Trying to "document" an undefined (not "define"d yet), causes gdb to crash. This is a build from git://sourceware.org/git/binutils-gdb.git at cbda14deaf49. (All directory names below are manually redacted and may contain typos.) I checked out gdb-binutils tree, configured with "--prefix /tmp/foo" and bu= ilt and installed with "make all" and "make install". Then, executing /tmp/foo/bin/gdb and just writing "document foo" gets me: (gdb) document foo Fatal signal: Segmentation fault ----- Backtrace ----- 0x55a2f1388169 gdb_internal_backtrace_1 /path/to/checkout/binutils-gdb-git/gdb/bt-utils.c:122 0x55a2f1388169 _Z22gdb_internal_backtracev /path/to/checkout/binutils-gdb-git/gdb/bt-utils.c:168 0x55a2f149fa6f handle_fatal_signal /path/to/checkout/binutils-gdb-git/gdb/event-top.c:964 0x55a2f149fbde handle_sigsegv /path/to/checkout/binutils-gdb-git/gdb/event-top.c:1037 0x7ff51c00013f ??? ./nptl/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0x55a2f13cc14e do_document_command /path/to/checkout/binutils-gdb-git/gdb/cli/cli-script.c:1519 0x55a2f13bbb34 _Z8cmd_funcP16cmd_list_elementPKci /path/to/checkout/binutils-gdb-git/gdb/cli/cli-decode.c:2543 0x55a2f16c2331 _Z15execute_commandPKci /path/to/checkout/binutils-gdb-git/gdb/top.c:692 0x55a2f14a081c _Z15command_handlerPKc /path/to/checkout/binutils-gdb-git/gdb/event-top.c:616 0x55a2f14a0bac _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE /path/to/checkout/binutils-gdb-git/gdb/event-top.c:860 0x55a2f14a11c0 gdb_rl_callback_handler /path/to/checkout/binutils-gdb-git/gdb/event-top.c:246 0x55a2f176d83f rl_callback_read_char /path/to/checkout/binutils-gdb-git/readline/readline/callback.c:290 0x55a2f149fc2d gdb_rl_callback_read_char_wrapper_noexcept /path/to/checkout/binutils-gdb-git/gdb/event-top.c:188 0x55a2f14a10a0 gdb_rl_callback_read_char_wrapper /path/to/checkout/binutils-gdb-git/gdb/event-top.c:221 0x55a2f149f93f stdin_event_handler /path/to/checkout/binutils-gdb-git/gdb/event-top.c:541 0x55a2f186fb25 gdb_wait_for_event /path/to/checkout/binutils-gdb-git/gdbsupport/event-loop.cc:694 0x55a2f1870353 gdb_wait_for_event /path/to/checkout/binutils-gdb-git/gdbsupport/event-loop.cc:593 0x55a2f1870353 _Z16gdb_do_one_eventi /path/to/checkout/binutils-gdb-git/gdbsupport/event-loop.cc:264 0x55a2f1575a79 start_event_loop /path/to/checkout/binutils-gdb-git/gdb/main.c:411 0x55a2f1575a79 captured_command_loop /path/to/checkout/binutils-gdb-git/gdb/main.c:471 0x55a2f1577564 captured_main /path/to/checkout/binutils-gdb-git/gdb/main.c:1330 0x55a2f1577564 _Z8gdb_mainP18captured_main_args /path/to/checkout/binutils-gdb-git/gdb/main.c:1345 0x55a2f12d9f7b main /path/to/checkout/binutils-gdb-git/gdb/gdb.c:32 --------------------- A fatal error internal to GDB has been detected, further debugging is not possible. GDB will now terminate. This is a bug, please report it. For instructions, see: . zsh: segmentation fault /foo/bin/bin/gdb ------- This seems to be a regression from that which Debian packaged, where "gdb --version" says "GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git", and where= the corresponding "document foo" gets me the somewhat more expected: ------- (gdb) document foo Undefined command: "foo". Try "help". (gdb)=20 ------- (FWIW, I actually sourced a script, where I had the document and define switched, but the crashing behavior is AFAICT identical.) --=20 You are receiving this mail because: You are on the CC list for the bug.=