From: Steve Shin Date: Fri, 2 Jun 2017 17:09:02 +0000 (-0700) Subject: Fix mac_age process crash in multi-threaded environment X-Git-Tag: v17.07-rc1~98 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=871cdec1b5fe5e0b0ccd70cf2e6fbedad0902c9f;p=vpp.git Fix mac_age process crash in multi-threaded environment VPP crash is observed when MAC aging is enabled with multi-threaded mode. If a thread other-than-zero expands the working_copies vector, working_copy_lengths should be initialized with vec_validate_init_empty(..., -1) to fill -1 across lower-numbered working_copy_lengths vector element. Change-Id: I60959fc6511306b33acae323df9c6898fc6c50ce Signed-off-by: Steve Shin --- diff --git a/src/vppinfra/bihash_template.c b/src/vppinfra/bihash_template.c index 7e4216bdeb9..7117f9941e2 100644 --- a/src/vppinfra/bihash_template.c +++ b/src/vppinfra/bihash_template.c @@ -100,8 +100,7 @@ BV (make_working_copy) (BVT (clib_bihash) * h, clib_bihash_bucket_t * b) { oldheap = clib_mem_set_heap (h->mheap); vec_validate (h->working_copies, thread_index); - vec_validate (h->working_copy_lengths, thread_index); - h->working_copy_lengths[thread_index] = -1; + vec_validate_init_empty (h->working_copy_lengths, thread_index, ~0); clib_mem_set_heap (oldheap); }