mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
10.01k stars 715 forks source link

Suspending client on start leads to the process quitting #3701

Open lenormf opened 4 years ago

lenormf commented 4 years ago

Might be a duplicate of #3069.

I was trying to start a client in the background, and send it files to open via kak -p, from the same shell.

Steps

I could also reproduce the behaviour by typing the keys "bg" right after the first step above.

Outcome

The whole terminal/shell gets closed, along with Kakoune.

Program received signal SIGHUP, Hangup.

#0  0x00007ff655cfdec2 in read () from /usr/lib/libc.so.6
#1  0x000055dbcc1f8129 in operator() (__closure=0x55dbcc4894c8 <Kakoune::NCursesUI::get_next_key()::get_char>) at ncurses_ui.cc:600
#2  0x000055dbcc1f9742 in Kakoune::NCursesUI::get_next_key (this=0x55dbce0da910) at ncurses_ui.cc:605
#3  0x000055dbcc1f5cc8 in operator() (__closure=0x55dbce0daae8) at ncurses_ui.cc:335
#4  0x000055dbcc2031af in std::__invoke_impl<void, Kakoune::NCursesUI::NCursesUI()::<lambda(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode)>&, Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/10.2.0/bits/invoke.h:60
#5  0x000055dbcc202d54 in std::__invoke_r<void, Kakoune::NCursesUI::NCursesUI()::<lambda(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode)>&, Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode>(struct {...} &) (__fn=...) at /usr/include/c++/10.2.0/bits/invoke.h:110
#6  0x000055dbcc2026e6 in std::_Function_handler<void(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode), Kakoune::NCursesUI::NCursesUI()::<lambda(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode)> >::_M_invoke(const std::_Any_data &, Kakoune::FDWatcher &, Kakoune::FdEvents &&, Kakoune::EventMode &&) (__functor=..., __args#0=..., __args#1=@0x7ffc711ff44c: Kakoune::FdEvents::Read, __args#2=@0x7ffc711ff448: Kakoune::EventMode::Normal) at /usr/include/c++/10.2.0/bits/std_function.h:291
#7  0x000055dbcc0df846 in std::function<void (Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode)>::operator()(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode) const (this=0x55dbce0daae8, __args#0=..., __args#1=Kakoune::FdEvents::Read, __args#2=Kakoune::EventMode::Normal) at /usr/include/c++/10.2.0/bits/std_function.h:622
#8  0x000055dbcc0de078 in Kakoune::FDWatcher::run (this=0x55dbce0daae0, events=Kakoune::FdEvents::Read, mode=Kakoune::EventMode::Normal) at event_manager.cc:24
#9  0x000055dbcc0ded88 in Kakoune::EventManager::handle_next_events (this=0x7ffc711ffc10, mode=Kakoune::EventMode::Normal, sigmask=0x0, block=true) at event_manager.cc:136
#10 0x000055dbcc1c2e1d in Kakoune::run_server (session="", server_init="", client_init="", init_coord=..., flags=(Kakoune::ServerFlags::IgnoreKakrc | Kakoune::ServerFlags::StartupInfo), ui_type=Kakoune::UIType::NCurses, debug_flags=Kakoune::DebugFlags::None, files=ArrayView<Kakoune::StringView>) at main.cc:857
#11 0x000055dbcc1c73ae in main (argc=2, argv=0x7ffc71200ec8) at main.cc:1202

>>> continue

Program received signal SIGTTIN, Stopped (tty input).

#0  Kakoune::signal_handler<&Kakoune::sighup_raised> () at ncurses_ui.cc:322
#1  <signal handler called>
#2  0x00007ff655cfdec0 in read () from /usr/lib/libc.so.6
#3  0x000055dbcc1f8129 in operator() (__closure=0x55dbcc4894c8 <Kakoune::NCursesUI::get_next_key()::get_char>) at ncurses_ui.cc:600
#4  0x000055dbcc1f9742 in Kakoune::NCursesUI::get_next_key (this=0x55dbce0da910) at ncurses_ui.cc:605
#5  0x000055dbcc1f5cc8 in operator() (__closure=0x55dbce0daae8) at ncurses_ui.cc:335
#6  0x000055dbcc2031af in std::__invoke_impl<void, Kakoune::NCursesUI::NCursesUI()::<lambda(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode)>&, Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/10.2.0/bits/invoke.h:60
#7  0x000055dbcc202d54 in std::__invoke_r<void, Kakoune::NCursesUI::NCursesUI()::<lambda(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode)>&, Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode>(struct {...} &) (__fn=...) at /usr/include/c++/10.2.0/bits/invoke.h:110
#8  0x000055dbcc2026e6 in std::_Function_handler<void(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode), Kakoune::NCursesUI::NCursesUI()::<lambda(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode)> >::_M_invoke(const std::_Any_data &, Kakoune::FDWatcher &, Kakoune::FdEvents &&, Kakoune::EventMode &&) (__functor=..., __args#0=..., __args#1=@0x7ffc711ff44c: Kakoune::FdEvents::Read, __args#2=@0x7ffc711ff448: Kakoune::EventMode::Normal) at /usr/include/c++/10.2.0/bits/std_function.h:291
#9  0x000055dbcc0df846 in std::function<void (Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode)>::operator()(Kakoune::FDWatcher&, Kakoune::FdEvents, Kakoune::EventMode) const (this=0x55dbce0daae8, __args#0=..., __args#1=Kakoune::FdEvents::Read, __args#2=Kakoune::EventMode::Normal) at /usr/include/c++/10.2.0/bits/std_function.h:622
#10 0x000055dbcc0de078 in Kakoune::FDWatcher::run (this=0x55dbce0daae0, events=Kakoune::FdEvents::Read, mode=Kakoune::EventMode::Normal) at event_manager.cc:24
#11 0x000055dbcc0ded88 in Kakoune::EventManager::handle_next_events (this=0x7ffc711ffc10, mode=Kakoune::EventMode::Normal, sigmask=0x0, block=true) at event_manager.cc:136
#12 0x000055dbcc1c2e1d in Kakoune::run_server (session="", server_init="", client_init="", init_coord=..., flags=(Kakoune::ServerFlags::IgnoreKakrc | Kakoune::ServerFlags::StartupInfo), ui_type=Kakoune::UIType::NCurses, debug_flags=Kakoune::DebugFlags::None, files=ArrayView<Kakoune::StringView>) at main.cc:857
#13 0x000055dbcc1c73ae in main (argc=2, argv=0x7ffc71200ec8) at main.cc:1202

[Inferior 1 (process 784792) exited with code 0377]

Expected

The server runs in the background, no UI is shown on screen, the shell remains usable.

lenormf commented 3 years ago

Running kak -n & closes the shell now.