<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi FRRTeam,<div><br></div><div>I am seeing an assert as below, while I tried to play a bit with FRR 7.2/stable  latest code.</div><div>code, with FPM enabled. Trigger for this is we tried to disable zebra .</div><div><br></div><div>This is highly reproducible if we enable FPM, with few 1-5routes/interface configured.<br></div><div>Here is the backtrace for the zebra core:  but let me know if you need more info:<br></div><div><br></div><div><div>i1".</div><div>Core was generated by `/usr/lib/frr/zebra -d -A 127.0.0.1 -M snmp -M fpm'.</div><div>Program terminated with signal SIGABRT, Aborted.</div><div>#0  0x00007f1456463428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54</div><div>54    ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.</div><div>[Current thread is 1 (Thread 0x7f1457641700 (LWP 403))]</div><div>(gdb) bt</div><div>#0  0x00007f1456463428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54</div><div>#1  0x00007f145646502a in __GI_abort () at abort.c:89</div><div>#2  0x00007f1457193188 in core_handler (signo=11, siginfo=0x7ffcb511eab0, context=0x7ffcb511e980) at lib/sigevent.c:228</div><div>#3  <signal handler called></div><div>#4  0x00007f1453e942a5 in rnode_is_srcnode (rn=0x2607400) at ./lib/srcdest_table.h:85</div><div>#5  0x00007f1453e942d3 in srcdest_rnode_table (rn=0x2607400) at ./lib/srcdest_table.h:90</div><div>#6  0x00007f1453e94359 in rib_dest_table (dest=0x2436050) at zebra/rib.h:471</div><div>#7  0x00007f1453e94373 in rib_dest_vrf (dest=0x2436050) at zebra/rib.h:479</div><div>#8  0x00007f1453e948d1 in netlink_route_info_fill (ri=0x7ffcb511f000, cmd=25, dest=0x2436050, re=0x0) at zebra/zebra_fpm_netlink.c:295</div><div>#9  0x00007f1453e953f5 in zfpm_netlink_encode_route (cmd=25, dest=0x2436050, re=0x0, in_buf=0x2528f34 "$", in_buf_len=8188) at zebra/zebra_fpm_netlink.c:575</div><div>#10 0x00007f1453e91c0e in zfpm_encode_route (dest=0x2436050, re=0x0, in_buf=0x2528f34 "$", in_buf_len=8188, msg_type=0x7ffcb511f2a4) at zebra/zebra_fpm.c:887</div><div>#11 0x00007f1453e91e10 in zfpm_build_route_updates () at zebra/zebra_fpm.c:990</div><div>#12 0x00007f1453e92290 in zfpm_build_updates () at zebra/zebra_fpm.c:1151</div><div>#13 0x00007f1453e9237f in zfpm_write_cb (thread=0x7ffcb511f5c0) at zebra/zebra_fpm.c:1189</div><div>#14 0x00007f14571a8240 in thread_call (thread=0x7ffcb511f5c0) at lib/thread.c:1757</div><div>#15 0x00007f145715fd71 in frr_run (master=0x2351ac0) at lib/libfrr.c:1054</div><div>#16 0x00000000004262bf in main (argc=8, argv=0x7ffcb511f878) at zebra/main.c:468</div><div>(gdb)</div></div><div><br></div><div><br></div><div><br></div><div>Here is the running config : </div><div><div>root@dcl4:~# vtysh-frr</div><div><br></div><div>Hello, this is FRRouting (version 7.2).</div><div>Copyright 1996-2005 Kunihiro Ishiguro, et al.</div><div><br></div><div>dcl4# show running-config</div><div>Building configuration...</div><div><br></div><div>Current configuration:</div><div>!</div><div>frr version 7.2</div><div>frr defaults traditional</div><div>hostname dcl4</div><div>log file zebra.log</div><div>log timestamp precision 6</div><div>agentx</div><div>log file bgpd.log</div><div>log file staticd.log</div><div>log file bfdd.log</div><div>!</div><div>debug zebra dplane</div><div>debug zebra events</div><div>debug zebra fpm</div><div>debug zebra kernel</div><div>debug zebra rib</div><div>!</div><div>debug vrf</div><div>!</div><div>enable password zebra</div><div>password zebra</div><div>!</div><div>router-id 1.1.1.1</div><div>!</div><div>router bgp 6500</div><div> bgp router-id 1.1.1.1</div><div> neighbor 10.37.0.17 remote-as 6500</div><div> !</div><div> address-family ipv4 unicast</div><div>  maximum-paths 1</div><div> exit-address-family</div><div> !</div><div> address-family ipv6 unicast</div><div>  maximum-paths 1</div><div> exit-address-family</div><div>!</div><div>line vty</div><div>!</div><div>end</div><div>dcl4#</div></div><div><br></div><div><br></div><div>My summary analysis after core analysis and code walk is:</div><div>While we do handle zebra:main.c:sigint(): </div><div>After vrf_terminate() is called, we  are still holding routes in FPM outbound queue.</div><div>And these routes need full context of route_node/route_info pointers, which are </div><div>freed in 'vrf_terminate()' call above:</div><div><br></div><div><br></div><div>==========================================================</div><div><div>/* SIGINT handler. */</div><div>static void sigint(void)</div><div>{</div><div>        struct vrf *vrf;</div><div>        struct zebra_vrf *zvrf;</div><div>        struct listnode *ln, *nn;</div><div>        struct zserv *client;</div><div>        static bool sigint_done;</div><div><br></div><div>        if (sigint_done)</div><div>                return;</div><div><br></div><div>        sigint_done = true;</div><div><br></div><div>        zlog_notice("Terminating on signal");</div><div><br></div><div>        frr_early_fini();</div><div><br></div><div>        zebra_dplane_pre_finish();</div><div><br></div><div>        for (ALL_LIST_ELEMENTS(zrouter.client_list, ln, nn, client))</div><div>                zserv_close_client(client);</div><div><br></div><div>        zserv_close();</div><div>        list_delete_all_node(zrouter.client_list);</div><div><br></div><div>        zebra_ptm_finish();</div><div><br></div><div>        if (retain_mode)</div><div>                RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {</div><div>                        zvrf = vrf->info;</div><div>                        if (zvrf)</div><div>                                SET_FLAG(zvrf->flags, ZEBRA_VRF_RETAIN);</div><div>                }</div><div>        if (zrouter.lsp_process_q)</div><div>                work_queue_free_and_null(&zrouter.lsp_process_q);</div><div>        vrf_terminate();</div><div>        ns_walk_func(zebra_ns_early_shutdown);</div><div>        zebra_ns_notify_close();</div><div><br></div><div>        access_list_reset();</div><div>        prefix_list_reset();</div><div>        route_map_finish();</div></div><div>......</div><div><br></div><div><br></div><div>===================================</div><div><br></div><div><div>/*</div><div> * netlink_route_info_fill</div><div> *</div><div> * Fill out the route information object from the given route.</div><div> *</div><div> * Returns true on success and false on failure.</div><div> */</div><div>static int netlink_route_info_fill(netlink_route_info_t *ri, int cmd,</div><div>                                   rib_dest_t *dest, struct route_entry *re)</div><div>{</div><div>        struct nexthop *nexthop;</div><div>        struct zebra_vrf *zvrf;</div><div><br></div><div>        memset(ri, 0, sizeof(*ri));</div><div><br></div><div>        ri->prefix = rib_dest_prefix(dest);<------Here also core seen sometimes</div><div>        ri->af = rib_dest_af(dest);<--------------Core seen while looking up info,</div><div><br></div><div>        ri->nlmsg_type = cmd;</div><div>        zvrf = rib_dest_vrf(dest);</div><div>        if (zvrf)</div></div><div><br></div><div>==================Zebra Logs===================(may not match exact code, but</div><div>this is a typical debug log pattern), I clearly see this assert is after vrf's are freed.</div><div>=============================================</div><div><div>oot@dorado-colo-leaf4:~# thongal/tail-rs.sh dcl4</div><div>2019/11/17 17:57:25.411522 ZEBRA: [EC 100663304] ERROR: No such command on config line 6: ptm-enable</div><div>2019/11/17 17:57:25.440060 ZEBRA: client 29 says hello and bids fair to announce only bfd routes vrf=0</div><div>2019/11/17 17:57:25.468711 ZEBRA: client 34 says hello and bids fair to announce only static routes vrf=0</div><div>2019/11/17 17:57:28.142658 ZEBRA: client 40 says hello and bids fair to announce only bgp routes vrf=0</div><div>2019/11/17 17:57:42.226148 ZEBRA: if_zebra_speed_update: eth0.500 old speed: 0 new speed: 10000</div><div>2019/11/17 17:57:44.910151 ZEBRA: if_zebra_speed_update: eth1.4092 old speed: 0 new speed: 10000</div><div><br></div><div><br></div><div>2019/11/17 18:02:05.107662 ZEBRA: connection closed socket [40]</div><div>2019/11/17 18:02:05.107729 ZEBRA: [EC 4043309116] Client 'bgp' encountered an error and is shutting down.</div><div>2019/11/17 18:02:05.107825 ZEBRA: Closing client 'bgp'</div><div>2019/11/17 18:02:05.107926 ZEBRA: release_daemon_table_chunks: Released 0 table chunks</div><div>2019/11/17 18:02:05.107966 ZEBRA: zebra/zebra_ptm.c:1441 failed to find process pid registration</div><div>2019/11/17 18:02:05.108017 ZEBRA: client 40 disconnected. 0 bgp routes removed from the rib</div><div>2019/11/17 18:02:05.504982 ZEBRA: Terminating on signal</div><div>2019/11/17 18:02:05.505038 ZEBRA: Zebra dataplane pre-fini called</div><div>2019/11/17 18:02:05.505170 ZEBRA: Closing client 'bfd'</div><div>2019/11/17 18:02:05.505249 ZEBRA: release_daemon_table_chunks: Released 0 table chunks</div><div>2019/11/17 18:02:05.505310 ZEBRA: client 29 disconnected. 0 bfd routes removed from the rib</div><div>2019/11/17 18:02:05.505496 ZEBRA: Closing client 'static'</div><div>2019/11/17 18:02:05.505566 ZEBRA: release_daemon_table_chunks: Released 0 table chunks</div><div>2019/11/17 18:02:05.505657 ZEBRA: rib_delnode: 0:<a href="http://92.10.1.0/24">92.10.1.0/24</a>: rn 0x1cbf3c0, re 0x1cbee40, removing</div><div>2019/11/17 18:02:05.505691 ZEBRA: rib_delnode: 0:<a href="http://93.10.1.0/24">93.10.1.0/24</a>: rn 0x1cbf620, re 0x1cbf4c0, removing</div><div>2019/11/17 18:02:05.505711 ZEBRA: rib_delnode: 0:<a href="http://94.10.1.0/24">94.10.1.0/24</a>: rn 0x1cbf880, re 0x1cbf720, removing</div><div>2019/11/17 18:02:05.505731 ZEBRA: client 34 disconnected. 3 static routes removed from the rib</div><div>2019/11/17 18:02:05.505870 ZEBRA: vrf_terminate: Shutting down vrf subsystem</div><div>2019/11/17 18:02:05.505903 ZEBRA: VRF 0 is to be deleted.</div><div>2019/11/17 18:02:05.505930 ZEBRA: VRF 0 is to be disabled.</div><div>2019/11/17 18:02:05.505955 ZEBRA: VRF default id 0 is now inactive(deleting routes, but not freeing)</div><div>2019/11/17 18:02:05.505988 ZEBRA: MESSAGE: ZEBRA_VRF_DELETE default</div><div>2019/11/17 18:02:05.506052 ZEBRA: VRF default id 0 deleted</div><div>2019/11/17 18:02:05.506095 ZEBRA: netlink_route_multipath(): RTM_DELROUTE <a href="http://92.10.1.0/24">92.10.1.0/24</a> vrf 0(254)</div><div>2019/11/17 18:02:05.506126 ZEBRA: rib_unlink: 0:<a href="http://10.37.0.0/20">10.37.0.0/20</a>: rn 0x1c9a9c0, re 0x1ab02e0</div><div>2019/11/17 18:02:05.506156 ZEBRA: netlink_talk: netlink-dp (NS 0) type RTM_DELROUTE(25), len=44 seq=8 flags 0x401</div><div>2019/11/17 18:02:05.506185 ZEBRA: rib_unlink: 0:<a href="http://92.10.1.0/24">92.10.1.0/24</a>: rn 0x1cbf3c0, re 0x1cbee40</div><div>2019/11/17 18:02:05.506212 ZEBRA: rib_unlink: 0:<a href="http://93.10.1.0/24">93.10.1.0/24</a>: rn 0x1cbf620, re 0x1cbf4c0</div><div>2019/11/17 18:02:05.506238 ZEBRA: netlink_route_multipath(): RTM_DELROUTE <a href="http://93.10.1.0/24">93.10.1.0/24</a> vrf 0(254)</div><div>2019/11/17 18:02:05.506272 ZEBRA: rib_unlink: 0:<a href="http://94.10.1.0/24">94.10.1.0/24</a>: rn 0x1cbf880, re 0x1cbf720</div><div>2019/11/17 18:02:05.506304 ZEBRA: netlink_talk: netlink-dp (NS 0) type RTM_DELROUTE(25), len=44 seq=9 flags 0x401</div><div>2019/11/17 18:02:05.506338 ZEBRA: rib_unlink: 0:<a href="http://172.179.1.0/24">172.179.1.0/24</a>: rn 0x1cd8020, re 0x1cd7f40</div><div>2019/11/17 18:02:05.506366 ZEBRA: netlink_route_multipath(): RTM_DELROUTE <a href="http://94.10.1.0/24">94.10.1.0/24</a> vrf 0(254)</div><div>2019/11/17 18:02:05.506407 ZEBRA: netlink_talk: netlink-dp (NS 0) type RTM_DELROUTE(25), len=44 seq=10 flags 0x401</div><div>2019/11/17 18:02:05.506444 ZEBRA: rib_unlink: 0:<a href="http://10.37.0.0/20">10.37.0.0/20</a> (MRIB): rn 0x1cbed60, re 0x1cbec80</div><div>2019/11/17 18:02:05.506479 ZEBRA: rib_unlink: 0:<a href="http://172.179.1.0/24">172.179.1.0/24</a> (MRIB): rn 0x1cd8220, re 0x1cd8140</div><div>2019/11/17 18:02:05.506576 ZEBRA: Zebra dataplane fini called</div><div>2019/11/17 18:02:05.506637 ZEBRA: Zebra dataplane shutdown status check called</div><div>2019/11/17 18:02:05.506667 ZEBRA: Failed to find route for ctx: no table for afi 1, safi 1, vrf 0</div><div>2019/11/17 18:02:05.506706 ZEBRA: Failed to process dplane results: no route for 0:<a href="http://10.37.0.0/20">10.37.0.0/20</a></div><div>2019/11/17 18:02:05.506744 ZEBRA: Failed to find route for ctx: no table for afi 1, safi 1, vrf 0</div><div>2019/11/17 18:02:05.506791 ZEBRA: Failed to process dplane results: no route for 0:<a href="http://92.10.1.0/24">92.10.1.0/24</a></div><div>2019/11/17 18:02:05.506822 ZEBRA: Failed to find route for ctx: no table for afi 1, safi 1, vrf 0</div><div>2019/11/17 18:02:05.506848 ZEBRA: Failed to process dplane results: no route for 0:<a href="http://93.10.1.0/24">93.10.1.0/24</a></div><div>2019/11/17 18:02:05.506877 ZEBRA: Failed to find route for ctx: no table for afi 1, safi 1, vrf 0</div><div>2019/11/17 18:02:05.506905 ZEBRA: Failed to process dplane results: no route for 0:<a href="http://94.10.1.0/24">94.10.1.0/24</a></div><div>2019/11/17 18:02:05.506935 ZEBRA: Failed to find route for ctx: no table for afi 1, safi 1, vrf 0</div><div>2019/11/17 18:02:05.506964 ZEBRA: Failed to process dplane results: no route for 0:<a href="http://172.179.1.0/24">172.179.1.0/24</a></div><div>ZEBRA: Received signal 11 at 1574042525 (si_addr 0x2bca8, PC 0x7f69611dd2a7); aborting...</div><div>Program counter: /usr/lib/frr/modules/zebra_fpm.so(+0x62a7)[0x7f69611dd2a7]</div><div>Backtrace for 19 stack frames:</div><div>/usr/lib/libfrr.so.0(zlog_backtrace_sigsafe+0x6d)[0x7f69644abd10]</div><div>/usr/lib/libfrr.so.0(zlog_signal+0x1a1)[0x7f69644abbee]</div><div>/usr/lib/libfrr.so.0(+0x8e10c)[0x7f69644dc10c]</div><div>/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f6963b52390]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x62a7)[0x7f69611dd2a7]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x62d5)[0x7f69611dd2d5]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x635b)[0x7f69611dd35b]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x6375)[0x7f69611dd375]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x68d3)[0x7f69611dd8d3]</div><div>/usr/lib/frr/modules/zebra_fpm.so(zfpm_netlink_encode_route+0x6d)[0x7f69611de3f7]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x3c10)[0x7f69611dac10]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x3e12)[0x7f69611dae12]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x4292)[0x7f69611db292]</div><div>/usr/lib/frr/modules/zebra_fpm.so(+0x4381)[0x7f69611db381]</div><div>/usr/lib/libfrr.so.0(thread_call+0xb3)[0x7f69644f11e2]</div><div>/usr/lib/libfrr.so.0(frr_run+0x229)[0x7f69644a8d53]</div><div>/usr/lib/frr/zebra(main+0x37e)[0x4262b0]</div><div>/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f6963797830]</div><div>/usr/lib/frr/zebra(_start+0x29)[0x4129a9]</div><div>in thread zfpm_write_cb scheduled from zebra/zebra_fpm.c:482</div><div>2019/11/17 18:02:06.458539 ZEBRA: client 29 says hello and bids fair to announce only bfd routes vrf=0</div><div>2019/11/17 18:02:06.488917 ZEBRA: client 34 says hello and bids fair to announce only static routes vrf=0</div><div>2019/11/17 18:02:06.575787 ZEBRA: connection to the FPM has gone down: closed socket in read</div><div>=============================================================</div></div><div>Any help appreciated, Do not see any bugs/issue filed on this yet on github.</div><div><br></div><div>Thanks</div><div>Thippanna</div></div></div></div></div></div></div></div></div>