ocochard / BSDRP

BSD Router Project
https://bsdrp.net
Other
175 stars 38 forks source link

"show ip bgp neighbors json" on frr crash bgpd #25

Closed ocochard closed 5 years ago

ocochard commented 5 years ago

Reported by thebug on IRC, and reproduced with BSDRP 1.91, under the bgp lab:

R4# show bgp summary

IPv6 Unicast Summary:
BGP router identifier 0.0.0.204, local AS number 64512 vrf-id 0
BGP table version 7
RIB entries 13, using 1976 bytes of memory
Peers 4, using 54 KiB of memory

Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
2001:db8:2::3   4        100       5       8        0    0    0 00:00:20            3
2001:db8:3::5   4      64512       6       6        0    0    0 00:00:30            4

Total number of neighbors 2
R4# show ip bgp neighbors json
vtysh: error reading from bgpd: No such file or directory (2)Warning: closing connection to bgpd because of an I/O error!
R4# show bgp summary
bgpd is not running
ocochard commented 5 years ago

Found log about:

[root@router]~# cat /tmp/quagga.bgpd.crashlog
BGP: Received signal 11 at 1542668164 (si_addr 0x889cb5160); aborting...
Backtrace for 5 stack frames:
0x8009a0d8c <zlog_backtrace_sigsafe+0x3c> at /usr/local/lib/libfrr.so.0
0x8009a05ad <zlog_signal+0x5bd> at /usr/local/lib/libfrr.so.0
0x8009b7044 <signal_init+0x234> at /usr/local/lib/libfrr.so.0
0x801676954 <pthread_sigmask+0x544> at /lib/libthr.so.3
0x801675eb2 <pthread_getspecific+0xe12> at /lib/libthr.so.3
in thread vtysh_read scheduled from lib/vty.c:2561

and code related:

2552 #ifdef VTYSH
2553     case VTYSH_SERV:
2554         vty_serv_thread = thread_add_read(vty_master, vtysh_accept, vty,
2555                           sock, NULL);
2556         vector_set_index(Vvty_serv_thread, sock, vty_serv_thread);
2557         break;
2558     case VTYSH_READ:
2559         vty->t_read = NULL;
2560         thread_add_read(vty_master, vtysh_read, vty, sock,
2561                 &vty->t_read);
2562         break;
2563     case VTYSH_WRITE:
2564         vty->t_write = NULL;
2565         thread_add_write(vty_master, vtysh_write, vty, sock,
2566                  &vty->t_write);
2567         break;
2568 #endif /* VTYSH */
2569     case VTY_READ:
ocochard commented 5 years ago

Same problem on FRR 6.0:

R4# show version
FRRouting 6.0 (R4).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
     '--enable-user=frr' '--enable-group=frr' '--enable-vty-group=frrvty' '--sysconfdir=/usr/local/etc/frr' '--localstatedir=/var/run/frr' '--disable-nhrpd' '--disable-pimd' '--enable-fpm'
'--disable-ldpd' '--enable-multipath=64' '--without-libpam' '--enable-rpki' '--disable-shell-access' '--disable-snmp' '--disable-tcmalloc' '--disable-tcp-zebra' '--enable-vtysh' '--prefix=/
usr/local' '--mandir=/usr/local/man' '--disable-silent-rules' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd11.2' 'build_alias=amd64-portbld-freebsd11.2' 'PKG_CONFIG=pkgc
onf' 'CC=cc' 'CFLAGS=-O2 -pipe  -fstack-protector -fno-strict-aliasing ' 'LDFLAGS= -L/usr/local/lib -L/usr/local/lib -fstack-protector ' 'LIBS=' 'CPPFLAGS=-I/usr/local/include -I/usr/local/
include' 'CPP=cpp'
R4# show bgp summary

IPv4 Unicast Summary:
BGP router identifier 0.0.0.204, local AS number 64512 vrf-id 0
BGP table version 4
RIB entries 7, using 1120 bytes of memory
Peers 4, using 54 KiB of memory

Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
10.0.2.3        4        100       5       6        0    0    0 00:01:24            3
10.0.3.5        4      64512       0       0        0    0    0    never       Active

Total number of neighbors 2

IPv6 Unicast Summary:
BGP router identifier 0.0.0.204, local AS number 64512 vrf-id 0
BGP table version 7
RIB entries 13, using 2080 bytes of memory
Peers 4, using 54 KiB of memory

Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
2001:db8:2::3   4        100       5       9        0    0    0 00:01:24            3
2001:db8:3::5   4      64512       7       6        0    0    0 00:01:16            4

Total number of neighbors 2
R4# show ip bgp neighbors json
vtysh: error reading from bgpd: No such file or directory (2)Warning: closing connection to bgpd because of an I/O error!
R4# show bgp summary
Warning: connecting to bgpd...failed!
bgpd is not running
ocochard commented 5 years ago

I've tried to debug this problem myself but failed, so I've created https://github.com/FRRouting/frr/issues/3365

qlyoung commented 5 years ago

Thank you for your report, this will be patched in FRR 6.0.1.

ocochard commented 5 years ago

Forgot to close this issue since BSDRP includes FRR 6.0.2