diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-11-29 21:51:45 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-11-29 21:51:45 +0100 |
commit | c3343a755fb01e3be9efadad75be719a5b7a3676 (patch) | |
tree | bdcabaed4e245653640b0926eb24024172a81224 /zebra/zebra_router.c | |
parent | Merge pull request #9703 from donaldsharp/splitup_bgp_gr (diff) | |
download | frr-c3343a755fb01e3be9efadad75be719a5b7a3676.tar.xz frr-c3343a755fb01e3be9efadad75be719a5b7a3676.zip |
zebra: Prevent thread usage of data after it being freed
On startup we create a thread timer event to do a rib sweep
of the system. On shutdown we never stopped this timer and
as such we have a situation where a thread event could be run
on shutdown after the data for it has been freed. Here is the
crash I am seeing:
(gdb) bt
(gdb)
Save the thread data in zebra_router and stop the thread so we don't
accidently do work on shutdown we don't mean to. In this case
it happened in our topotests with some severe system load.
Essentially we happened to kill the zebra daemon just as the
graceful_restart timer popped here.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_router.c')
-rw-r--r-- | zebra/zebra_router.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index a80c57385..92a3b9424 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -232,6 +232,8 @@ void zebra_router_terminate(void) { struct zebra_router_table *zrt, *tmp; + THREAD_OFF(zrouter.sweeper); + RB_FOREACH_SAFE (zrt, zebra_router_table_head, &zrouter.tables, tmp) zebra_router_free_table(zrt); |