public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/30557] New: Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766
@ 2023-06-15 18:33 zwelf at strct dot cc
  2023-07-03 16:15 ` [Bug cli/30557] " meator.dev at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zwelf at strct dot cc @ 2023-06-15 18:33 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30557
           Summary: Exception after pressing tab to autocomplete in
                    location_completer gdb/completer.c:766
           Product: gdb
           Version: 13.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: zwelf at strct dot cc
  Target Milestone: ---

I encountered a crash. Here is the stack trace. Using `GNU gdb (GDB) 13.1` from
arch repros.

```
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f2a81bb22d3 in __pthread_kill_internal (signo=6, threadid=<optimized
out>) at pthread_kill.c:78
#2  0x00007f2a81b62a08 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
#3  0x00005611e8d3519a in handle_fatal_signal (sig=6) at
../../gdb/event-top.c:979
#4  <signal handler called>
#5  __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#6  0x00007f2a81bb22d3 in __pthread_kill_internal (signo=6, threadid=<optimized
out>) at pthread_kill.c:78
#7  0x00007f2a81b62a08 in __GI_raise (sig=sig@entry=6) at
../sysdeps/posix/raise.c:26
#8  0x00007f2a81b4b538 in __GI_abort () at abort.c:79
#9  0x00007f2a81e9ca6f in __gnu_cxx::__verbose_terminate_handler () at
/usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#10 0x00007f2a81eb011c in __cxxabiv1::__terminate (handler=<optimized out>) at
/usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#11 0x00007f2a81eaf0aa in __cxa_call_terminate (ue_header=0x5611eade2000) at
/usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_call.cc:54
#12 0x00007f2a81eaf82a in __cxxabiv1::__gxx_personality_v0 (version=<optimized
out>, actions=6, exception_class=5138137972254386944, ue_header=<optimized
out>, context=0x7ffcee55fe10)
    at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_personality.cc:688
#13 0x00007f2a8287458a in _Unwind_RaiseException_Phase2
(exc=exc@entry=0x5611eade2000, context=context@entry=0x7ffcee55fe10,
frames_p=frames_p@entry=0x7ffcee55fd18) at
/usr/src/debug/gcc/gcc/libgcc/unwind.inc:64
#14 0x00007f2a8287508d in _Unwind_Resume (exc=exc@entry=0x5611eade2000) at
/usr/src/debug/gcc/gcc/libgcc/unwind.inc:242
#15 0x00005611e8b6efa6 in location_completer (ignore=<optimized out>,
tracker=..., text=<optimized out>) at ../../gdb/completer.c:766
#16 0x00005611e8c821ba in complete_line_internal_1 (tracker=...,
text=<optimized out>, line_buffer=<optimized out>, point=<optimized out>,
reason=<optimized out>) at ../../gdb/completer.c:1438
#17 0x00005611e8c8510a in complete_line_internal (tracker=..., text=<optimized
out>, line_buffer=<optimized out>, point=<optimized out>, reason=<optimized
out>) at ../../gdb/completer.c:1457
#18 0x00005611e8c8792c in gdb_completion_word_break_characters_throw () at
../../gdb/completer.c:1907
#19 gdb_completion_word_break_characters () at ../../gdb/completer.c:1945
#20 0x00007f2a82b341aa in _rl_find_completion_word (fp=fp@entry=0x7ffcee560328,
dp=dp@entry=0x7ffcee56032c) at ../complete.c:1091
#21 0x00007f2a82b39f9d in rl_complete_internal (what_to_do=9) at
../complete.c:2027
#22 0x00007f2a82b31430 in _rl_dispatch_subseq (key=9, map=<optimized out>,
got_subseq=0) at ../readline.c:916
#23 0x00007f2a82b319c6 in _rl_dispatch (key=<optimized out>, map=<optimized
out>) at ../readline.c:860
#24 0x00007f2a82b32248 in readline_internal_char () at ../readline.c:675
#25 0x00007f2a82b52406 in rl_callback_read_char () at ../callback.c:272
#26 0x00005611e8d38154 in gdb_rl_callback_read_char_wrapper_noexcept () at
../../gdb/event-top.c:188
#27 0x00005611e8d382d4 in gdb_rl_callback_read_char_wrapper
(client_data=<optimized out>) at ../../gdb/event-top.c:221
#28 0x00005611e8d39900 in stdin_event_handler (error=<optimized out>,
client_data=0x5611ea3086f0) at ../../gdb/event-top.c:541
#29 0x00005611e90bad5e in gdb_wait_for_event (block=<optimized out>) at
../gdbsupport/../../gdbsupport/event-loop.cc:716
#30 0x00005611e910c4fa in gdb_do_one_event(int) [clone .constprop.0]
(mstimeout=-1) at ../gdbsupport/../../gdbsupport/event-loop.cc:264
#31 0x00005611e8e374a5 in start_event_loop () at ../../gdb/main.c:411
#32 captured_command_loop () at ../../gdb/main.c:471
#33 0x00005611e8b92665 in captured_main (data=0x7ffcee560580) at
../../gdb/main.c:1330
#34 gdb_main (args=0x7ffcee560580) at ../../gdb/main.c:1345
#35 main (argc=<optimized out>, argv=<optimized out>) at ../../gdb/gdb.c:32
```

```
(gdb) bt full
#0  __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {18446744073709551576}}
        ret = <optimized out>
#1  0x00007f2a81bb22d3 in __pthread_kill_internal (signo=6, threadid=<optimized
out>) at pthread_kill.c:78
No locals.
#2  0x00007f2a81b62a08 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x00005611e8d3519a in handle_fatal_signal (sig=6) at
../../gdb/event-top.c:979
        sig_write = <optimized out>
#4  <signal handler called>
No locals.
#5  __pthread_kill_implementation (threadid=<optimized out>,
signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {139820545026096}}
        ret = <optimized out>
#6  0x00007f2a81bb22d3 in __pthread_kill_internal (signo=6, threadid=<optimized
out>) at pthread_kill.c:78
No locals.
#7  0x00007f2a81b62a08 in __GI_raise (sig=sig@entry=6) at
../sysdeps/posix/raise.c:26
        ret = <optimized out>
#8  0x00007f2a81b4b538 in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20},
sa_mask = {__val = {139820543268419, 2664, 139820541832100, 24, 1, 10,
139820505722624, 140724307098576, 139820555296896, 4, 139820541839449, 
              139820543268288, 139820541840627, 139820543268288, 10,
139820505722624}}, sa_flags = -2118501110, sa_restorer = 0x7f2a81d05780
<stderr>}
#9  0x00007f2a81e9ca6f in __gnu_cxx::__verbose_terminate_handler () at
/usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
        terminating = true
        t = <optimized out>
#10 0x00007f2a81eb011c in __cxxabiv1::__terminate (handler=<optimized out>) at
/usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
No locals.
#11 0x00007f2a81eaf0aa in __cxa_call_terminate (ue_header=0x5611eade2000) at
/usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_call.cc:54
        xh = 0x5611eade1fb0
#12 0x00007f2a81eaf82a in __cxxabiv1::__gxx_personality_v0 (version=<optimized
out>, actions=6, exception_class=5138137972254386944, ue_header=<optimized
out>, context=0x7ffcee55fe10)
    at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_personality.cc:688
        found_something = <optimized out>
        install_context = <optimized out>
        found_nothing = found_nothing
        found_terminate = found_terminate
        found_cleanup = found_cleanup
        found_handler = found_handler
        found_type = <optimized out>
        info = {Start = 94634926438868, LPStart = 94634926438889, ttype_base =
4, TType = 0x5611e92938f9 "\f\a\b\220\001", action_table = 0x7ffcee55fe10
"\b\377U\356\374\177", ttype_encoding = 157 '\235', call_site_encoding = 54
'6'}
        language_specific_data = <optimized out>
        action_record = <optimized out>
        p = <optimized out>
        landing_pad = <optimized out>
        ip = <optimized out>
        handler_switch_value = <optimized out>
        thrown_ptr = 0x0
        foreign_exception = <optimized out>
        ip_before_insn = 0
        xh = <optimized out>
#13 0x00007f2a8287458a in _Unwind_RaiseException_Phase2
(exc=exc@entry=0x5611eade2000, context=context@entry=0x7ffcee55fe10,
frames_p=frames_p@entry=0x7ffcee55fd18) at
/usr/src/debug/gcc/gcc/libgcc/unwind.inc:64
        fs = {regs = {reg = {{loc = {reg = 0, offset = 0, exp = 0x0}}, {loc =
{reg = 140724307099472, offset = 140724307099472, exp = 0x7ffcee55ff50 ""}},
{loc = {reg = 18446744073709551544, offset = -72, 
                  exp = 0xffffffffffffffb8 <error: Cannot access memory at
address 0xffffffffffffffb8>}}, {loc = {reg = 18446744073709551592, offset =
-24, 
                  exp = 0xffffffffffffffe8 <error: Cannot access memory at
address 0xffffffffffffffe8>}}, {loc = {reg = 140724307098856, offset =
140724307098856, exp = 0x7ffcee55fce8 " \375U\356\374\177"}}, {loc = {
                  reg = 18446744073709551560, offset = -56, exp =
0xffffffffffffffc8 <error: Cannot access memory at address
0xffffffffffffffc8>}}, {loc = {reg = 18446744073709551600, offset = -16, 
                  exp = 0xfffffffffffffff0 <error: Cannot access memory at
address 0xfffffffffffffff0>}}, {loc = {reg = 140724307099416, offset =
140724307099416, exp = 0x7ffcee55ff18 ""}}, {loc = {reg = 18446744073709551600, 
                  offset = -16, exp = 0xfffffffffffffff0 <error: Cannot access
memory at address 0xfffffffffffffff0>}}, {loc = {reg = 0, offset = 0, exp =
0x0}}, {loc = {reg = 140724307099424, offset = 140724307099424, 
                  exp = 0x7ffcee55ff20 "\250\377U\356\374\177"}}, {loc = {reg =
140724307098328, offset = 140724307098328, exp = 0x7ffcee55fad8 ""}}, {loc =
{reg = 18446744073709551584, offset = -32, 
                  exp = 0xffffffffffffffe0 <error: Cannot access memory at
address 0xffffffffffffffe0>}}, {loc = {reg = 18446744073709551592, offset =
-24, 
                  exp = 0xffffffffffffffe8 <error: Cannot access memory at
address 0xffffffffffffffe8>}}, {loc = {reg = 18446744073709551600, offset =
-16, 
                  exp = 0xfffffffffffffff0 <error: Cannot access memory at
address 0xfffffffffffffff0>}}, {loc = {reg = 18446744073709551600, offset =
-16, 
                  exp = 0xfffffffffffffff0 <error: Cannot access memory at
address 0xfffffffffffffff0>}}, {loc = {reg = 18446744073709551608, offset = -8, 
                  exp = 0xfffffffffffffff8 <error: Cannot access memory at
address 0xfffffffffffffff8>}}, {loc = {reg = 18446744073709551592, offset =
-24, 
                  exp = 0xffffffffffffffe8 <error: Cannot access memory at
address 0xffffffffffffffe8>}}}, how =
"\000\000\000\001\000\000\001\000\000\000\000\000\000\000\000\000\001", cfa_how
= CFA_REG_OFFSET, prev = 0x0, 
            cfa_offset = 96, cfa_reg = 7, cfa_exp = 0x0}, pc = 0x5611e8d38258
<gdb_rl_callback_read_char_wrapper_noexcept()+392>, 
          personality = 0x7f2a81eaf790 <__cxxabiv1::__gxx_personality_v0(int,
_Unwind_Action, _Unwind_Exception_Class, _Unwind_Exception*,
_Unwind_Context*)>, data_align = -8, code_align = 1, retaddr_column = 16, 
          fde_encoding = 27 '\033', lsda_encoding = 27 '\033', saw_z = 1
'\001', signal_frame = 0 '\000', eh_ptr = 0x0}
        match_handler = <optimized out>
        code = <optimized out>
        frames = 10
#14 0x00007f2a8287508d in _Unwind_Resume (exc=exc@entry=0x5611eade2000) at
/usr/src/debug/gcc/gcc/libgcc/unwind.inc:242
        this_context = {reg = {0x7ffcee55ff08, 0x7ffcee55ff10, 0x0,
0x7ffcee55ff18, 0x0, 0x0, 0x7ffcee55ff40, 0x0, 0x0, 0x0, 0x0, 0x0,
0x7ffcee55ff20, 0x7ffcee55ff28, 0x7ffcee55ff30, 0x7ffcee55ff38, 0x7ffcee55ff48,
0x0}, 
          cfa = 0x7ffcee55ff50, ra = 0x5611e8b6efa6
<location_completer(cmd_list_element*, completion_tracker&, char const*, char
const*)-1166442>, lsda = 0x0, bases = {tbase = 0x0, dbase = 0x74c, 
            func = 0x7f2a82874f60 <_Unwind_Resume>}, flags =
4611686018427387904, version = 0, args_size = 0, by_value = '\000' <repeats 17
times>}
        cur_context = {reg = {0x7ffcee55ff08, 0x7ffcee55ff10, 0x0,
0x7ffcee560410, 0x0, 0x0, 0x7ffcee560418, 0x0, 0x0, 0x0, 0x0, 0x0,
0x7ffcee560420, 0x7ffcee560428, 0x7ffcee560430, 0x7ffcee5603d0, 0x7ffcee560438,
0x0}, 
          cfa = 0x7ffcee560440, ra = 0x5611e8d38154
<gdb_rl_callback_read_char_wrapper_noexcept()+132>, lsda = 0x5611e9351569,
bases = {tbase = 0x0, dbase = 0x1dfcc, func = 0x5611e8d380d0
<gdb_rl_callback_read_char_wrapper_noexcept()>}, 
          flags = 4611686018427387904, version = 0, args_size = 0, by_value =
'\000' <repeats 17 times>}
        code = <optimized out>
        frames = 140724307100102
#15 0x00005611e8b6efa6 in location_completer (ignore=<optimized out>,
tracker=..., text=<optimized out>) at ../../gdb/completer.c:766
        found_probe_option = -1
        option_text = <optimized out>
        saved_word_point = 6
        copy = 0x7ffcee5601c6 "en"
        completion_info = {last_option = 0x0, quoted_arg_start = 0x0,
quoted_arg_end = 0x0, saw_explicit_location_spec_option = false}
        locspec = std::unique_ptr<location_spec> = {get() = 0x0}
#16 0x00005611e8c821ba in complete_line_internal_1 (tracker=...,
text=<optimized out>, line_buffer=<optimized out>, point=<optimized out>,
reason=<optimized out>) at ../../gdb/completer.c:1438
        tmp_command = 0x7ffcee5601c0 "break en"
        p = 0x7ffcee5601c6 "en"
        ignore_help_classes = 1
        word = <optimized out>
        c = <optimized out>
        result_list = 0x5611ea3dc210
        __func__ = <optimized out>
#17 0x00005611e8c8510a in complete_line_internal (tracker=..., text=<optimized
out>, line_buffer=<optimized out>, point=<optimized out>, reason=<optimized
out>) at ../../gdb/completer.c:1457
No locals.
#18 0x00005611e8c8792c in gdb_completion_word_break_characters_throw () at
../../gdb/completer.c:1907
        tracker = @0x5611ea599420: {m_completion_match_result = {match =
{m_match = 0x7f2a58013300 "core::str::<impl
str>::encode_utf16::hf07f819e7d513362", m_storage = ""}, match_for_lcd = {
              m_match = 0x7f2a58013317 "encode_utf16::hf07f819e7d513362",
m_ignored_ranges = std::vector of length 1, capacity 1 = {{first =
0x7f2a5801330b "<impl str>::encode_utf16::hf07f819e7d513362", 
                  second = 0x7f2a58013315
"::encode_utf16::hf07f819e7d513362"}}, m_finished_storage = ""}},
m_entries_hash = std::unique_ptr<htab> = {get() = 0x5611eae38e40}, m_quote_char
= 0, m_use_custom_word_point = true, 
          m_custom_word_point = 6, m_suppress_append_ws = false,
m_lowest_common_denominator = 0x0, m_lowest_common_denominator_unique = false,
m_lowest_common_denominator_valid = false,
m_lowest_common_denominator_max_length = 227}
        tracker = <optimized out>
        __func__ = <optimized out>
#19 gdb_completion_word_break_characters () at ../../gdb/completer.c:1945
No locals.
#20 0x00007f2a82b341aa in _rl_find_completion_word (fp=fp@entry=0x7ffcee560328,
dp=dp@entry=0x7ffcee56032c) at ../complete.c:1091
        scan = <optimized out>
        end = 8
        found_quote = 0
        delimiter = 0
        pass_next = <optimized out>
        isbrk = <optimized out>
        quote_char = 0 '\000'
        brkchars = 0x0
#21 0x00007f2a82b39f9d in rl_complete_internal (what_to_do=9) at
../complete.c:2027
        matches = 0x0
        our_func = 0x7f2a82b38730 <rl_filename_completion_function>
        start = <optimized out>
        end = 8
        delimiter = 0
        found_quote = 0
        i = <optimized out>
        nontrivial_lcd = <optimized out>
        text = <optimized out>
        saved_line_buffer = 0x5611eaa7bfe0 "break en"
        quote_char = 0 '\000'
        tlen = <optimized out>
        mlen = <optimized out>
        saved_last_completion_failed = 0
#22 0x00007f2a82b31430 in _rl_dispatch_subseq (key=9, map=<optimized out>,
got_subseq=0) at ../readline.c:916
        r = 0
        newkey = <optimized out>
        macro = <optimized out>
        func = <optimized out>
        cxt = <optimized out>
#23 0x00007f2a82b319c6 in _rl_dispatch (key=<optimized out>, map=<optimized
out>) at ../readline.c:860
No locals.
#24 0x00007f2a82b32248 in readline_internal_char () at ../readline.c:675
        c = <optimized out>
        code = <optimized out>
        lk = 0
        r = <optimized out>
        lastc = 9
        eof_found = <optimized out>
#25 0x00007f2a82b52406 in rl_callback_read_char () at ../callback.c:272
        line = <optimized out>
        eof = <optimized out>
        jcode = <optimized out>
        olevel = {{__jmpbuf = {140724307100832, 2377292934506987412,
139820558370696, 94634928112640, 139820560609280, 94634927104632,
2400716111975137172, 2377292984838373268}, __mask_was_saved = 0, __saved_mask =
{__val = {
                0 <repeats 16 times>}}}}
#26 0x00005611e8d38154 in gdb_rl_callback_read_char_wrapper_noexcept () at
../../gdb/event-top.c:188
        gdb_expt = {reason = 0, error = GDB_NO_ERROR, message =
std::shared_ptr<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >> (empty) = {get() = 0x0}}
#27 0x00005611e8d382d4 in gdb_rl_callback_read_char_wrapper
(client_data=<optimized out>) at ../../gdb/event-top.c:221
        gdb_expt = {reason = 0, error = GDB_NO_ERROR, message =
std::shared_ptr<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >> (empty) = {get() = 0x0}}
#28 0x00005611e8d39900 in stdin_event_handler (error=<optimized out>,
client_data=0x5611ea3086f0) at ../../gdb/event-top.c:541
        ui = 0x5611ea3086f0
#29 0x00005611e90bad5e in gdb_wait_for_event (block=<optimized out>) at
../gdbsupport/../../gdbsupport/event-loop.cc:716
        mask = <optimized out>
        file_ptr = <optimized out>
        num_found = <optimized out>
        __func__ = <optimized out>
#30 0x00005611e910c4fa in gdb_do_one_event(int) [clone .constprop.0]
(mstimeout=-1) at ../gdbsupport/../../gdbsupport/event-loop.cc:264
        number_of_sources = 3
        current = <optimized out>
        timer_id = <optimized out>
        scope_exit_251 = <optimized out>
        event_source_head = <optimized out>
#31 0x00005611e8e374a5 in start_event_loop () at ../../gdb/main.c:411
        result = 0
#32 captured_command_loop () at ../../gdb/main.c:471
        ui = 0x5611ea3086f0
#33 0x00005611e8b92665 in captured_main (data=0x7ffcee560580) at
../../gdb/main.c:1330
        context = 0x7ffcee560580
        context = <optimized out>
        ex = <optimized out>
#34 gdb_main (args=0x7ffcee560580) at ../../gdb/main.c:1345
No locals.
#35 main (argc=<optimized out>, argv=<optimized out>) at ../../gdb/gdb.c:32
        args = {argc = 4, argv = 0x7ffcee5606c8, interpreter_p = 0x5611e914b004
"console"}
```

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/30557] Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766
  2023-06-15 18:33 [Bug cli/30557] New: Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766 zwelf at strct dot cc
@ 2023-07-03 16:15 ` meator.dev at gmail dot com
  2023-07-03 18:33 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: meator.dev at gmail dot com @ 2023-07-03 16:15 UTC (permalink / raw)
  To: gdb-prs

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

meator <meator.dev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |meator.dev at gmail dot com

--- Comment #1 from meator <meator.dev at gmail dot com> ---
I have encountered the same issue. I am unfortunately not familiar with GDB
internals but I will try to provide steps to reproduce this issue.

I am running gdb 13.2 (which is higher than the version marked in this bug
report).

A visual showcase of this bug can be found here:
https://asciinema.org/a/594536.

I have created a Dockerfile which can reproduce the issue. It can be found
here: https://drive.google.com/file/d/1fQIJ8gvEaiFLXRU1MLtlwn7YlEeTTNyq/view

The file is uploaded via Google Drive. I can reupload this file somewhere else
if needed.

The archive contains two things: the Dockerfile and copy of my unfinished
project related to matrixes. The project is largely unrelated to the bug but I
was able to trigger it when creating a breakpoint in one of the classes
contained in the project.

You can look at the Dockerfile to reproduce the issue manually.

My backtraces are similar to zwelf's, but it should be noted that gdb initially
fails with this error message:

terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_M_replace

My backtraces are here:
https://drive.google.com/file/d/1t3yZKfkRwO-knn4Ndu7KtMI0-kUskAye/view

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/30557] Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766
  2023-06-15 18:33 [Bug cli/30557] New: Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766 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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2023-07-03 18:33 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
A docker file is maybe not the best way to get us a reproducer.
Do you have a (hopefully small) example program we could try?

The other thing to try would be to rebuild gdb without optimization.
Maybe that would let us see the data a bit better.
Or, stop gdb when the exception is thrown, go up a bit into gdb
code, and poke around...

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/30557] Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766
  2023-06-15 18:33 [Bug cli/30557] New: Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766 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
  2023-09-20 10:53 ` hi at alyssa dot is
  2023-09-21  1:14 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: manas18244 at iiitd dot ac.in @ 2023-08-28 14:57 UTC (permalink / raw)
  To: gdb-prs

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/30557] Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766
  2023-06-15 18:33 [Bug cli/30557] New: Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766 zwelf at strct dot cc
                   ` (2 preceding siblings ...)
  2023-08-28 14:57 ` manas18244 at iiitd dot ac.in
@ 2023-09-20 10:53 ` hi at alyssa dot is
  2023-09-21  1:14 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: hi at alyssa dot is @ 2023-09-20 10:53 UTC (permalink / raw)
  To: gdb-prs

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

Alyssa Ross <hi at alyssa dot is> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hi at alyssa dot is

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/30557] Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766
  2023-06-15 18:33 [Bug cli/30557] New: Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766 zwelf at strct dot cc
                   ` (3 preceding siblings ...)
  2023-09-20 10:53 ` hi at alyssa dot is
@ 2023-09-21  1:14 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2023-09-21  1:14 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
   Target Milestone|---                         |14.1
         Resolution|---                         |FIXED

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
Thanks for the reproducer.
I think you did find the commit that fixes this;
I tried git master and it works fine.
Thank you.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-21  1:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 18:33 [Bug cli/30557] New: Exception after pressing tab to autocomplete in location_completer gdb/completer.c:766 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
2023-09-20 10:53 ` hi at alyssa dot is
2023-09-21  1:14 ` tromey at sourceware dot org

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).