Re: gdb crashes on current

2024-03-21 Thread Brett Lymn
On Wed, Mar 20, 2024 at 10:02:41PM +, Patrick Welche wrote:
> 
> Just had a go, and "tui enable" doesn't get as far as libcurses
> 

How odd.  I tried this on my system which was last updated June 14 last
year and both running gdb then doing tui enable or just running gdb -tui
Just Works(tm).

I have gdb:

GNU gdb (GDB) 11.0.50.20200914-git

I guess I will have to update and see what happens.

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

Pad being NULL is a Bad Thing.  That variable should contain a pointer
to a WINDOW structure.

-- 
Brett Lymn
--
Sent from my NetBSD device.

"We are were wolves",
"You mean werewolves?",
"No we were wolves, now we are something else entirely",
"Oh"


Re: gdb crashes on current

2024-03-20 Thread Patrick Welche
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  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
> [Current thread is 1 (process 12621)]
> (gdb) bt
> #0  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
> #1  0x0101ef97 in handle_fatal_signal(int) ()
> #2  0x0101f152 in handle_sigsegv(int) ()
> #3  
> #4  0x756547e679e1 in prefresh () from /usr/lib/libcurses.so.9
> #5  0x00eec1a0 in tui_source_window_base::refresh_window() ()
> #6  0x00eedf18 in tui_unhighlight_win(tui_win_info*) ()
> #7  0x00eec5f8 in
> tui_source_window_base::do_erase_source_content(char const*) ()
> #8  0x00ef60e5 in tui_layout_split::apply(int, int, int, int, bool) ()
> #9  0x00ef4aa8 in tui_apply_current_layout(bool) ()
> #10 0x00ef4ddb in tui_set_layout(tui_layout_split*) ()
> #11 0x00ee4f2f in tui_enable() ()
> #12 0x00ee5487 in tui_rl_switch_mode(int, int) ()
> #13 0x01379fa8 in _rl_dispatch_subseq ()
> #14 0x0137aa27 in _rl_dispatch_callback ()
> #15 0x0135a1f1 in rl_callback_read_char ()
> #16 0x0101f40e in gdb_rl_callback_read_char_wrapper_noexcept() ()
> #17 0x0102020d in gdb_rl_callback_read_char_wrapper(void*) ()
> #18 0x0101eeb1 in stdin_event_handler(int, void*) ()
> #19 0x01300eba in gdb_wait_for_event(int) [clone .part.0] ()
> #20 0x0130155a in gdb_do_one_event(int) ()
> #21 0x00fa0576 in captured_command_loop() ()
> #22 0x00fa2113 in gdb_main(captured_main_args*) ()
> #23 0x013c66fb in main ()

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

(gdb) bt
#0  0x7f7ff78dfffa in ?? ()
#1  0x00222b45 in gdb_rl_callback_handler ()
at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:262
#2  0x00222cfa 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::allocator >, (__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::allocator > >::~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  0x7f7ff78e00b0 in ?? ()
#8  0x0001000b in ?? ()
#9  0x 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  0x000f60ff in tui_source_window_base::refresh_window ()
at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-winsource.c:267
#2  0x000f7e68 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  0x000f6552 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  0x0010008b in tui_layout_split::apply ()
at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-layout.c:1019
#6  0x000fe927 in tui_apply_current_layout ()
at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-layout.c:81
#7  0x000fec65 in tui_set_layout ()
at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-layout.c:150
#8  0x000f1f2f in tui_enable ()
at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui.c:452
#9  0x001c319c in interp_set ()
at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/interps.c:191
#10 0x001a7c55 in captured_main_1 ()
at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/main.c:1145
#11 0x001a8b0f 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 0x005be5cf 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  0x000f60ff in tui_source_window_base::refresh_window ()
at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/tui/tui-winsource.c:267
267   

Re: gdb crashes on current

2024-03-20 Thread Rhialto
On Thu 21 Mar 2024 at 00:29:40 +0500, Vitaly Shevtsov wrote:
> Hello!
> 
> It's when you run it with the `-tui` option - text user interface.
> Also you can toggle it with C-x C-a

or with "tui enable" and "tui disable", too...
It can be kind of nice, when it works.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert
\X/ There is no AI. There is just someone else's work.   --I. Rose


signature.asc
Description: PGP signature


Re: gdb crashes on current

2024-03-20 Thread Vitaly Shevtsov
cli is the main mode in gdb but it also has a built-in pseudo graphic mode :)

On Thu, Mar 21, 2024 at 12:48 AM Justin Parrott
 wrote:
>
> The last I checked gdb it was a command line interfaced system.
>
> On Wed, Mar 20, 2024 at 3:47 PM Vitaly Shevtsov  wrote:
>>
>> Sorry, what do you mean? :)
>> It's native pseudo graphic interface
>>
>> On Thu, Mar 21, 2024 at 12:34 AM Justin Parrott
>>  wrote:
>> >
>> > Is that not the Default?
>> >
>> > On Wed, Mar 20, 2024 at 3:30 PM Vitaly Shevtsov  
>> > wrote:
>> >>
>> >> Hello!
>> >>
>> >> It's when you run it with the `-tui` option - text user interface.
>> >> Also you can toggle it with C-x C-a
>> >>
>> >> https://sourceware.org/gdb/current/onlinedocs/gdb.html/TUI.html
>> >>
>> >> On Thu, Mar 21, 2024 at 12:21 AM Justin Parrott
>> >>  wrote:
>> >> >
>> >> > What is TUI mode?
>> >> >
>> >> > On Wed, Mar 20, 2024 at 2:34 PM 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  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
>> >> >> [Current thread is 1 (process 12621)]
>> >> >> (gdb) bt
>> >> >> #0  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
>> >> >> #1  0x0101ef97 in handle_fatal_signal(int) ()
>> >> >> #2  0x0101f152 in handle_sigsegv(int) ()
>> >> >> #3  
>> >> >> #4  0x756547e679e1 in prefresh () from /usr/lib/libcurses.so.9
>> >> >> #5  0x00eec1a0 in tui_source_window_base::refresh_window() ()
>> >> >> #6  0x00eedf18 in tui_unhighlight_win(tui_win_info*) ()
>> >> >> #7  0x00eec5f8 in
>> >> >> tui_source_window_base::do_erase_source_content(char const*) ()
>> >> >> #8  0x00ef60e5 in tui_layout_split::apply(int, int, int, int, 
>> >> >> bool) ()
>> >> >> #9  0x00ef4aa8 in tui_apply_current_layout(bool) ()
>> >> >> #10 0x00ef4ddb in tui_set_layout(tui_layout_split*) ()
>> >> >> #11 0x00ee4f2f in tui_enable() ()
>> >> >> #12 0x00ee5487 in tui_rl_switch_mode(int, int) ()
>> >> >> #13 0x01379fa8 in _rl_dispatch_subseq ()
>> >> >> #14 0x0137aa27 in _rl_dispatch_callback ()
>> >> >> #15 0x0135a1f1 in rl_callback_read_char ()
>> >> >> #16 0x0101f40e in gdb_rl_callback_read_char_wrapper_noexcept() 
>> >> >> ()
>> >> >> #17 0x0102020d in gdb_rl_callback_read_char_wrapper(void*) ()
>> >> >> #18 0x0101eeb1 in stdin_event_handler(int, void*) ()
>> >> >> #19 0x01300eba in gdb_wait_for_event(int) [clone .part.0] ()
>> >> >> #20 0x0130155a in gdb_do_one_event(int) ()
>> >> >> #21 0x00fa0576 in captured_command_loop() ()
>> >> >> #22 0x00fa2113 in gdb_main(captured_main_args*) ()
>> >> >> #23 0x013c66fb in main ()
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Justin Allen Parrott
>> >> > The Renegade of Fairfax, Va.
>> >> > The Sun of the Mourning
>> >> >
>> >
>> >
>> >
>> > --
>> > Justin Allen Parrott
>> > The Renegade of Fairfax, Va.
>> > The Sun of the Mourning
>> >
>
>
>
> --
> Justin Allen Parrott
> The Renegade of Fairfax, Va.
> The Sun of the Mourning
>


Re: gdb crashes on current

2024-03-20 Thread Vitaly Shevtsov
Sorry, what do you mean? :)
It's native pseudo graphic interface

On Thu, Mar 21, 2024 at 12:34 AM Justin Parrott
 wrote:
>
> Is that not the Default?
>
> On Wed, Mar 20, 2024 at 3:30 PM Vitaly Shevtsov  wrote:
>>
>> Hello!
>>
>> It's when you run it with the `-tui` option - text user interface.
>> Also you can toggle it with C-x C-a
>>
>> https://sourceware.org/gdb/current/onlinedocs/gdb.html/TUI.html
>>
>> On Thu, Mar 21, 2024 at 12:21 AM Justin Parrott
>>  wrote:
>> >
>> > What is TUI mode?
>> >
>> > On Wed, Mar 20, 2024 at 2:34 PM 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  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
>> >> [Current thread is 1 (process 12621)]
>> >> (gdb) bt
>> >> #0  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
>> >> #1  0x0101ef97 in handle_fatal_signal(int) ()
>> >> #2  0x0101f152 in handle_sigsegv(int) ()
>> >> #3  
>> >> #4  0x756547e679e1 in prefresh () from /usr/lib/libcurses.so.9
>> >> #5  0x00eec1a0 in tui_source_window_base::refresh_window() ()
>> >> #6  0x00eedf18 in tui_unhighlight_win(tui_win_info*) ()
>> >> #7  0x00eec5f8 in
>> >> tui_source_window_base::do_erase_source_content(char const*) ()
>> >> #8  0x00ef60e5 in tui_layout_split::apply(int, int, int, int, 
>> >> bool) ()
>> >> #9  0x00ef4aa8 in tui_apply_current_layout(bool) ()
>> >> #10 0x00ef4ddb in tui_set_layout(tui_layout_split*) ()
>> >> #11 0x00ee4f2f in tui_enable() ()
>> >> #12 0x00ee5487 in tui_rl_switch_mode(int, int) ()
>> >> #13 0x01379fa8 in _rl_dispatch_subseq ()
>> >> #14 0x0137aa27 in _rl_dispatch_callback ()
>> >> #15 0x0135a1f1 in rl_callback_read_char ()
>> >> #16 0x0101f40e in gdb_rl_callback_read_char_wrapper_noexcept() ()
>> >> #17 0x0102020d in gdb_rl_callback_read_char_wrapper(void*) ()
>> >> #18 0x0101eeb1 in stdin_event_handler(int, void*) ()
>> >> #19 0x01300eba in gdb_wait_for_event(int) [clone .part.0] ()
>> >> #20 0x0130155a in gdb_do_one_event(int) ()
>> >> #21 0x00fa0576 in captured_command_loop() ()
>> >> #22 0x00fa2113 in gdb_main(captured_main_args*) ()
>> >> #23 0x013c66fb in main ()
>> >
>> >
>> >
>> > --
>> > Justin Allen Parrott
>> > The Renegade of Fairfax, Va.
>> > The Sun of the Mourning
>> >
>
>
>
> --
> Justin Allen Parrott
> The Renegade of Fairfax, Va.
> The Sun of the Mourning
>


Re: gdb crashes on current

2024-03-20 Thread Vitaly Shevtsov
Hello!

It's when you run it with the `-tui` option - text user interface.
Also you can toggle it with C-x C-a

https://sourceware.org/gdb/current/onlinedocs/gdb.html/TUI.html

On Thu, Mar 21, 2024 at 12:21 AM Justin Parrott
 wrote:
>
> What is TUI mode?
>
> On Wed, Mar 20, 2024 at 2:34 PM 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  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
>> [Current thread is 1 (process 12621)]
>> (gdb) bt
>> #0  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
>> #1  0x0101ef97 in handle_fatal_signal(int) ()
>> #2  0x0101f152 in handle_sigsegv(int) ()
>> #3  
>> #4  0x756547e679e1 in prefresh () from /usr/lib/libcurses.so.9
>> #5  0x00eec1a0 in tui_source_window_base::refresh_window() ()
>> #6  0x00eedf18 in tui_unhighlight_win(tui_win_info*) ()
>> #7  0x00eec5f8 in
>> tui_source_window_base::do_erase_source_content(char const*) ()
>> #8  0x00ef60e5 in tui_layout_split::apply(int, int, int, int, bool) 
>> ()
>> #9  0x00ef4aa8 in tui_apply_current_layout(bool) ()
>> #10 0x00ef4ddb in tui_set_layout(tui_layout_split*) ()
>> #11 0x00ee4f2f in tui_enable() ()
>> #12 0x00ee5487 in tui_rl_switch_mode(int, int) ()
>> #13 0x01379fa8 in _rl_dispatch_subseq ()
>> #14 0x0137aa27 in _rl_dispatch_callback ()
>> #15 0x0135a1f1 in rl_callback_read_char ()
>> #16 0x0101f40e in gdb_rl_callback_read_char_wrapper_noexcept() ()
>> #17 0x0102020d in gdb_rl_callback_read_char_wrapper(void*) ()
>> #18 0x0101eeb1 in stdin_event_handler(int, void*) ()
>> #19 0x01300eba in gdb_wait_for_event(int) [clone .part.0] ()
>> #20 0x0130155a in gdb_do_one_event(int) ()
>> #21 0x00fa0576 in captured_command_loop() ()
>> #22 0x00fa2113 in gdb_main(captured_main_args*) ()
>> #23 0x013c66fb in main ()
>
>
>
> --
> Justin Allen Parrott
> The Renegade of Fairfax, Va.
> The Sun of the Mourning
>


gdb crashes on current

2024-03-20 Thread Vitaly Shevtsov
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  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
[Current thread is 1 (process 12621)]
(gdb) bt
#0  0x756547929fba in _lwp_kill () from /usr/lib/libc.so.12
#1  0x0101ef97 in handle_fatal_signal(int) ()
#2  0x0101f152 in handle_sigsegv(int) ()
#3  
#4  0x756547e679e1 in prefresh () from /usr/lib/libcurses.so.9
#5  0x00eec1a0 in tui_source_window_base::refresh_window() ()
#6  0x00eedf18 in tui_unhighlight_win(tui_win_info*) ()
#7  0x00eec5f8 in
tui_source_window_base::do_erase_source_content(char const*) ()
#8  0x00ef60e5 in tui_layout_split::apply(int, int, int, int, bool) ()
#9  0x00ef4aa8 in tui_apply_current_layout(bool) ()
#10 0x00ef4ddb in tui_set_layout(tui_layout_split*) ()
#11 0x00ee4f2f in tui_enable() ()
#12 0x00ee5487 in tui_rl_switch_mode(int, int) ()
#13 0x01379fa8 in _rl_dispatch_subseq ()
#14 0x0137aa27 in _rl_dispatch_callback ()
#15 0x0135a1f1 in rl_callback_read_char ()
#16 0x0101f40e in gdb_rl_callback_read_char_wrapper_noexcept() ()
#17 0x0102020d in gdb_rl_callback_read_char_wrapper(void*) ()
#18 0x0101eeb1 in stdin_event_handler(int, void*) ()
#19 0x01300eba in gdb_wait_for_event(int) [clone .part.0] ()
#20 0x0130155a in gdb_do_one_event(int) ()
#21 0x00fa0576 in captured_command_loop() ()
#22 0x00fa2113 in gdb_main(captured_main_args*) ()
#23 0x013c66fb in main ()