clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
215 stars 72 forks source link

backend will be terminated if resizing bash window when backend in foreground mode #295

Closed nowaits closed 2 years ago

nowaits commented 2 years ago

Hi olof,

backend will be terminated if resizing bash window when backend in foreground mode. Here is the error log:

Jan  7 02:39:35: clixon_event_reg_timeout: backend stream timer
Jan  7 02:39:35: clixon_event_loop timeout: vpp ha timer
Jan  7 02:39:35: clixon_event_reg_timeout: vpp ha timer
Jan  7 02:39:36: clixon_event_loop select: Interrupted system call
Jan  7 02:39:36: clixon_event_loop: 402: Event error: select: Interrupted system call
Jan  7 02:39:36: clixon_event_loop err
Jan  7 02:39:36: clixon_event_loop done:-1
Jan  7 02:39:36: clixon_backend: 26268 Terminated retval:-1
Jan  7 02:39:36: backend_terminate

Breakpoint 2, backend_exit (h=0x606000000020) at /home/dev/code/net-base/mgmt/backend/main.c:262
262     {
Missing separate debuginfos, use: debuginfo-install libgcc-4.8.5-44.el7.x86_64 libstdc++-4.8.5-44.el7.x86_64
(gdb) bt
#0  backend_exit (h=0x606000000020) at /home/dev/code/net-base/mgmt/backend/main.c:262
#1  0x00007ffff7f29bb7 in clixon_plugin_exit_one () from /home/dev/code/net-base/dist/script/../lib/libclixon.so.5
#2  0x00007ffff7f29ef3 in clixon_plugin_exit_all () from /home/dev/code/net-base/dist/script/../lib/libclixon.so.5
#3  0x00007ffff7f2bf5d in clixon_plugin_module_exit () from /home/dev/code/net-base/dist/script/../lib/libclixon.so.5
#4  0x000000000040785d in backend_terminate ()
#5  0x000000000040b124 in main ()
(gdb) 
olofhagsand commented 2 years ago

I cannot recreate it, but possibly it has to do with SIGWINCH. Maybe one could try something like

   set_signal(SIGWINCH, SIG_IGN, NULL);

Can you try something like that in backend_main? Otherwise please try to catch which signal it is?

nowaits commented 2 years ago

I find the crash reasion: In the backend, i created cligen_handle by cligen_init in Plugin start callabck, the handle is used for validating the cli script (cligen_parse_str), i have fixed my local bug.

Thanks your tips!