From 87627de6c067b5abba4713b21c0d74551064da46 Mon Sep 17 00:00:00 2001 From: Mobashshera Rasool Date: Tue, 12 Jan 2021 11:31:17 +0000 Subject: [PATCH] ospfd: deleting ospf process is leading to crash at no_router_ospf Topology diagram: ------------------------- +---+ A0 +---+ +R1 +------------+R2 | +-+-+- +--++ | -- -- | | -- A0 -- | A0| ---- | | ---- | A0 | -- -- | | -- -- | +-+-+- +-+-+ +R0 +-------------+R3 | +---+ A0 +---+ Steps to reproduce: -------------------------- 1. Bring up the base config as per the topology 2. Configure OSPF on all the routers of the topology. 3. Configure 5 static routes from the same network on R0 , 5 static routes from different networks and redistribute in R0 4. Configure External Route summary in R0 to summarise 5 routes to one route. 5. Delete the configured summary 6. configure the summary again and delete static routes . 7. Add back static routes. 8. Configure new static route which is matching the configured summary. 9. Delete one of the static route. 10. Configure redistribute connected and configure ospf external summary address to summarise the connected routes. 11. Clear ospf process and check for any errors. [New LWP 2346] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/usr/lib/frr/ospfd'. Program terminated with signal SIGABRT, Aborted. 54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt 0 0x00007f296f278428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 1 0x00007f296f27a02a in __GI_abort () at abort.c:89 2 0x00007f296fca4110 in core_handler (signo=11, siginfo=0x7ffcd52044f0, context=) at lib/sigevent.c:254 3 4 0x000055949b9dfdff in ospf_lsdb_lookup (lsdb=lsdb@entry=0x55949bfd3688, lsa=lsa@entry=0x55949bfe1290) at ospfd/ospf_lsdb.c:179 5 0x000055949ba28fbe in ospf_ls_retransmit_lookup (lsa=0x55949bfe1290, nbr=0x55949bfd3610) at ospfd/ospf_flood.c:918 6 ospf_ls_retransmit_delete_nbr_if (oi=oi@entry=0x55949bfd2590, lsa=lsa@entry=0x55949bfe1290) at ospfd/ospf_flood.c:932 7 0x000055949ba2916b in ospf_ls_retransmit_delete_nbr_if (lsa=0x55949bfe1290, oi=0x55949bfd2590) at ospfd/ospf_flood.c:928 8 ospf_ls_retransmit_delete_nbr_as (ospf=ospf@entry=0x55949bfbdb30, lsa=lsa@entry=0x55949bfe1290) at ospfd/ospf_flood.c:959 9 0x000055949b9dcd7e in ospf_discard_from_db (ospf=ospf@entry=0x55949bfbdb30, lsdb=, lsa=lsa@entry=0x55949bfe1630) at ospfd/ospf_lsa.c:2552 10 0x000055949b9df1b3 in ospf_maxage_lsa_remover (thread=0x55949bfde930) at ospfd/ospf_lsa.c:2848 11 0x00007f296fcb1770 in thread_call (thread=0x55949bfde930) at lib/thread.c:1557 12 0x00007f296fcb19d6 in funcname_thread_execute (m=0x55949be0a630, func=func@entry=0x55949b9df0a0 , arg=arg@entry=0x55949bfbdb30, val=val@entry=0, funcname=funcname@entry=0x55949ba31b41 "ospf_maxage_lsa_remover", schedfrom=schedfrom@entry=0x55949ba31917 "ospfd/ospf_lsa.c", fromln=3364) at lib/thread.c:1628 13 0x000055949b9de90b in ospf_flush_self_originated_lsas_now (ospf=ospf@entry=0x55949bfbdb30) at ospfd/ospf_lsa.c:3364 14 0x000055949ba19a55 in ospf_process_refresh_data (ospf=0x55949bfbdb30, reset=reset@entry=true) at ospfd/ospfd.c:138 15 0x000055949ba1aeef in ospf_process_reset (ospf=) at ospfd/ospfd.c:206 16 0x000055949ba0729b in clear_ip_ospf_process_magic (self=, vty=, argc=, argv=, instance_str=, instance=) at ospfd/ospf_vty.c:11930 17 clear_ip_ospf_process (self=, vty=0x55949bfe2600, argc=, argv=) at ./ospfd/ospf_vty_clippy.c:306 18 0x00007f296fc66523 in cmd_execute_command_real (vline=vline@entry=0x55949bfd2fb0, vty=vty@entry=0x55949bfe2600, cmd=cmd@entry=0x0, filter=FILTER_RELAXED) at lib/command.c:1060 19 0x00007f296fc6869a in cmd_execute_command (vline=vline@entry=0x55949bfd2fb0, vty=vty@entry=0x55949bfe2600, cmd=0x0, vtysh=vtysh@entry=0) at lib/command.c:1119 20 0x00007f296fc68817 in cmd_execute (vty=vty@entry=0x55949bfe2600, cmd=cmd@entry=0x55949bfe7f80 "clear ip ospf pro", matched=matched@entry=0x0, vtysh=vtysh@entry=0) at lib/command.c:1275 21 0x00007f296fcb6c13 in vty_command (vty=vty@entry=0x55949bfe2600, buf=0x55949bfe7f80 "clear ip ospf pro") at lib/vty.c:514 22 0x00007f296fcb6ea6 in vty_execute (vty=vty@entry=0x55949bfe2600) at lib/vty.c:1281 23 0x00007f296fcb97f4 in vtysh_read (thread=) at lib/vty.c:2123 24 0x00007f296fcb1770 in thread_call (thread=thread@entry=0x7ffcd5209590) at lib/thread.c:1557 25 0x00007f296fc82e78 in frr_run (master=0x55949be0a630) at lib/libfrr.c:1026 26 0x000055949b9d0f07 in main (argc=1, argv=0x7ffcd52098b8) at ospfd/ospf_main.c:230 Signed-off-by: Mobashshera Rasool --- ospfd/ospf_ase.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c index 6905b716ab..e18d8ddb31 100644 --- a/ospfd/ospf_ase.c +++ b/ospfd/ospf_ase.c @@ -748,8 +748,12 @@ void ospf_ase_unregister_external_lsa(struct ospf_lsa *lsa, struct ospf *top) if (rn) { lst = rn->info; - listnode_delete(lst, lsa); - ospf_lsa_unlock(&lsa); /* external_lsas list */ + struct listnode *node = listnode_lookup(lst, lsa); + /* Unlock lsa only if node is present in the list */ + if (node) { + listnode_delete(lst, lsa); + ospf_lsa_unlock(&lsa); /* external_lsas list */ + } route_unlock_node(rn); } -- 2.39.5