Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: gdb crashes on current



On Wed, Mar 20, 2024 at 11:33:30PM +0500, Vitaly Shevtsov wrote:
> Hello!
> 
> It seems that gdb from base NetBSD image doesn't work with netbsd's
> libcurses in tui mode:
> 
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x0000756547929fba in _lwp_kill () from /usr/lib/libc.so.12
> [Current thread is 1 (process 12621)]
> (gdb) bt
> #0  0x0000756547929fba in _lwp_kill () from /usr/lib/libc.so.12
> #1  0x000000000101ef97 in handle_fatal_signal(int) ()
> #2  0x000000000101f152 in handle_sigsegv(int) ()
> #3  <signal handler called>
> #4  0x0000756547e679e1 in prefresh () from /usr/lib/libcurses.so.9
> #5  0x0000000000eec1a0 in tui_source_window_base::refresh_window() ()
> #6  0x0000000000eedf18 in tui_unhighlight_win(tui_win_info*) ()
> #7  0x0000000000eec5f8 in
> tui_source_window_base::do_erase_source_content(char const*) ()
> #8  0x0000000000ef60e5 in tui_layout_split::apply(int, int, int, int, bool) ()
> #9  0x0000000000ef4aa8 in tui_apply_current_layout(bool) ()
> #10 0x0000000000ef4ddb in tui_set_layout(tui_layout_split*) ()
> #11 0x0000000000ee4f2f in tui_enable() ()
> #12 0x0000000000ee5487 in tui_rl_switch_mode(int, int) ()
> #13 0x0000000001379fa8 in _rl_dispatch_subseq ()
> #14 0x000000000137aa27 in _rl_dispatch_callback ()
> #15 0x000000000135a1f1 in rl_callback_read_char ()
> #16 0x000000000101f40e in gdb_rl_callback_read_char_wrapper_noexcept() ()
> #17 0x000000000102020d in gdb_rl_callback_read_char_wrapper(void*) ()
> #18 0x000000000101eeb1 in stdin_event_handler(int, void*) ()
> #19 0x0000000001300eba in gdb_wait_for_event(int) [clone .part.0] ()
> #20 0x000000000130155a in gdb_do_one_event(int) ()
> #21 0x0000000000fa0576 in captured_command_loop() ()
> #22 0x0000000000fa2113 in gdb_main(captured_main_args*) ()
> #23 0x00000000013c66fb in main ()

Just had a go, and "tui enable" doesn't get as far as libcurses

(gdb) bt
#0  0x00007f7ff78dfffa in ?? ()
#1  0x0000000000222b45 in gdb_rl_callback_handler ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:262
#2  0x0000000000222cfa in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count () at /usr/export/amd64/usr/include/g++/bits/shared_ptr_base.h:1070
#3  std::__shared_ptr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr ()
    at /usr/export/amd64/usr/include/g++/bits/shared_ptr_base.h:1524
#4  std::shared_ptr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~shared_ptr ()
    at /usr/export/amd64/usr/include/g++/bits/shared_ptr.h:175
#5  gdb_exception::~gdb_exception ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdbsupport/common-exceptions.h:114
#6  gdb_rl_callback_read_char_wrapper_noexcept ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:212
#7  0x00007f7ff78e00b0 in ?? ()
#8  0x000000010000000b in ?? ()
#9  0x0000000000000000 in ?? ()

but "gdb -tui" does:

Thread 1 "" received signal SIGSEGV, Segmentation faultprefresh (pad=0x0, pbegy=0, pbegx=0, sbegy=1, sbegx=5, smaxy=0, smaxx=78)
    at /usr/src/lib/libcurses/refresh.c:511
511             pad->pbegy = pbegy;
(gdb) bt
#0  prefresh (pad=0x0, pbegy=0, pbegx=0, sbegy=1, sbegx=5, smaxy=0, smaxx=78)
    at /usr/src/lib/libcurses/refresh.c:511
#1  0x00000000000f60ff in tui_source_window_base::refresh_window ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-winsource.c:267
#2  0x00000000000f7e68 in tui_unhighlight_win ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-wingeneral.c:138
#3  tui_unhighlight_win ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-wingeneral.c:131
#4  0x00000000000f6552 in tui_source_window_base::do_erase_source_content ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-winsource.c:219
#5  0x000000000010008b in tui_layout_split::apply ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-layout.c:1019
#6  0x00000000000fe927 in tui_apply_current_layout ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-layout.c:81
#7  0x00000000000fec65 in tui_set_layout ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-layout.c:150
#8  0x00000000000f1f2f in tui_enable ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui.c:452
#9  0x00000000001c319c in interp_set ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/interps.c:191
#10 0x00000000001a7c55 in captured_main_1 ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/main.c:1145
#11 0x00000000001a8b0f in captured_main ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/main.c:1320
#12 gdb_main ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/main.c:1345
#13 0x00000000005be5cf in main ()
    at /usr/src/external/gpl3/gdb/bin/gdb/../../dist/gdb/gdb.c:32
(gdb) print pad
$1 = (WINDOW *) 0x0
(gdb) frame 1
#1  0x00000000000f60ff in tui_source_window_base::refresh_window ()
    at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-winsource.c:267
267       prefresh (m_pad.get (), 0, pad_x, y + 1, x + left_margin,
(gdb) print m_pad
No symbol "m_pad" in current context.

?

Doesn't say optimized out... Get same for the other variables...


P


Home | Main Index | Thread Index | Old Index