public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "manas18244 at iiitd dot ac.in" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug cli/30557] Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766
Date: Mon, 28 Aug 2023 14:57:53 +0000	[thread overview]
Message-ID: <bug-30557-4717-9vSxM5nnE3@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30557-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30557

Manas <manas18244 at iiitd dot ac.in> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manas18244 at iiitd dot ac.in

--- Comment #3 from Manas <manas18244 at iiitd dot ac.in> ---
Created attachment 15090
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15090&action=edit
bug reproducible rust

I came across the following error while hitting <TAB> for auto-completing. Here
are the details and a reproducible. I built the GNU gdb (GDB) 13.2 from source.

The attached `gdb-bug.rs` can be built via `rustc gdb-bug.rs`, and run as `gdb
./gdb-bug`. Inside the debugger, type `br par<TAB>` and the following error is
thrown along with the trace.

```
@(gdb) br parterminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_M_replace


Fatal signal: Aborted
----- Backtrace -----
0x55e3ffd968db gdb_internal_backtrace_1
        /home/neon/gdb-13.2/gdb/bt-utils.c:122
0x55e3ffd968db _Z22gdb_internal_backtracev
        /home/neon/gdb-13.2/gdb/bt-utils.c:168
0x55e3ffeb3214 handle_fatal_signal
        /home/neon/gdb-13.2/gdb/event-top.c:956
0x7f7a8f43e70f ???
0x7f7a8f48e83c ???
0x7f7a8f43e667 ???
0x7f7a8f4264b7 ???
0x7f7a8f89ca6e _ZN9__gnu_cxx27__verbose_terminate_handlerEv
        /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
0x7f7a8f8b011b _ZN10__cxxabiv111__terminateEPFvvE
        /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
0x7f7a8f8af0a9 __cxa_call_terminate
        /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_call.cc:54
0x7f7a8f8af829 __gxx_personality_v0
        /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_personality.cc:688
0x7f7a8fb57529 _Unwind_RaiseException_Phase2
        /usr/src/debug/gcc/gcc/libgcc/unwind.inc:64
0x7f7a8fb5802c _Unwind_Resume
        /usr/src/debug/gcc/gcc/libgcc/unwind.inc:242
0x55e3ffcbccf8 _ZNKSt14default_deleteI13location_specEclEPS0_
        /usr/include/c++/13.2.1/bits/unique_ptr.h:99
0x55e3ffcbccf8 _ZNSt10unique_ptrI13location_specSt14default_deleteIS0_EED4Ev
        /usr/include/c++/13.2.1/bits/unique_ptr.h:404
0x55e3ffcbccf8
_Z18location_completerP16cmd_list_elementR18completion_trackerPKcS4_
        /home/neon/gdb-13.2/gdb/completer.c:1042
0x55e3ffdfc92e complete_line_internal_1
        /home/neon/gdb-13.2/gdb/completer.c:1438
0x55e3ffdfc9b5 complete_line_internal
        /home/neon/gdb-13.2/gdb/completer.c:1457
0x55e3ffdfdaf1 gdb_completion_word_break_characters_throw
        /home/neon/gdb-13.2/gdb/completer.c:1907
0x55e3ffdfdaf1 _Z36gdb_completion_word_break_charactersv
        /home/neon/gdb-13.2/gdb/completer.c:1945
0x55e4001bd43c _rl_find_completion_word
        /home/neon/gdb-13.2/readline/readline/complete.c:1089
0x55e4001be536 rl_complete_internal
        /home/neon/gdb-13.2/readline/readline/complete.c:2025
0x55e4001b3a22 _rl_dispatch_subseq
        /home/neon/gdb-13.2/readline/readline/readline.c:892
0x55e4001b419f _rl_dispatch
        /home/neon/gdb-13.2/readline/readline/readline.c:838
0x55e4001b419f readline_internal_char
        /home/neon/gdb-13.2/readline/readline/readline.c:650
0x55e4001d13ac rl_callback_read_char
        /home/neon/gdb-13.2/readline/readline/callback.c:264
0x55e3ffeb456d gdb_rl_callback_read_char_wrapper_noexcept
        /home/neon/gdb-13.2/gdb/event-top.c:188
0x55e3ffeb471f gdb_rl_callback_read_char_wrapper
        /home/neon/gdb-13.2/gdb/event-top.c:221
0x55e3ffeb30cf stdin_event_handler
        /home/neon/gdb-13.2/gdb/event-top.c:541
0x55e4002d9125 gdb_wait_for_event
        /home/neon/gdb-13.2/gdbsupport/event-loop.cc:716
0x55e4002d9c99 _Z16gdb_do_one_eventi
        /home/neon/gdb-13.2/gdbsupport/event-loop.cc:264
0x55e3fffa9839 start_event_loop
        /home/neon/gdb-13.2/gdb/main.c:411
0x55e3fffa9839 captured_command_loop
        /home/neon/gdb-13.2/gdb/main.c:471
0x55e3fffab4c4 captured_main
        /home/neon/gdb-13.2/gdb/main.c:1330
0x55e3fffab4c4 _Z8gdb_mainP18captured_main_args
        /home/neon/gdb-13.2/gdb/main.c:1345
0x55e3ffcebc19 main
        /home/neon/gdb-13.2/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:
<https://www.gnu.org/software/gdb/bugs/>.

Aborted (core dumped)
```

I also found this commit
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;f=gdb/completer.h;h=454f8b67a85130b6d6f6a7c987d868183b411369
which identifies and tackles this issue further, so I would just leave the
reproducible here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-08-28 14:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 18:33 [Bug cli/30557] New: " zwelf at strct dot cc
2023-07-03 16:15 ` [Bug cli/30557] " meator.dev at gmail dot com
2023-07-03 18:33 ` tromey at sourceware dot org
2023-08-28 14:57 ` manas18244 at iiitd dot ac.in [this message]
2023-09-20 10:53 ` hi at alyssa dot is
2023-09-21  1:14 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30557-4717-9vSxM5nnE3@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).