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

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