diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-15 21:10:57 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-30 01:37:08 +0200 |
commit | 62f44022399236ec619a6ebedd3bd6e11765fafd (patch) | |
tree | 8a03ce01b48119922e62bb313aa52fe92b30ea3f /lib/thread.h | |
parent | lib: mt-safe tracebacks (diff) | |
download | frr-62f44022399236ec619a6ebedd3bd6e11765fafd.tar.xz frr-62f44022399236ec619a6ebedd3bd6e11765fafd.zip |
lib: make `show thread...` commands mt-aware
This patch fixes up show thread commands so that they know about
and operate on all extant thread_masters, since we can now have multiple
running in any given application.
This change also eliminates a heap use after free that appears when
using a single cpu_record shared among multiple threads. Since struct
thread's have pointers to bits of memory that are freed when the global
statistics hash table is freed, later accesses are invalid. By moving
the stats hash to be unique to each thread_master this problem is
sidestepped.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r-- | lib/thread.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/thread.h b/lib/thread.h index 1760a930f..12c85fc14 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -80,6 +80,7 @@ struct thread_master struct list *cancel_req; bool canceled; pthread_cond_t cancel_cond; + struct hash *cpu_record; int io_pipe[2]; int fd_limit; struct fd_handler handler; |