From 6a782ca3b0782116c5f34d1c958998e9a0af41ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Ganne?= Date: Fri, 20 Jan 2023 09:52:01 +0100 Subject: [PATCH] vlib: make pending_interrupts valid for AddressSanitizer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit vec_alloc_aligned() pre-allocates the vector memory but does not update its size, making ASan unhappy when trying to access it. Type: fix Change-Id: I80e753cf2458cf516d1180a24cfaca4f382339d5 Signed-off-by: Benoît Ganne --- src/vlib/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vlib/main.c b/src/vlib/main.c index 964bc4a04e9..dc21a3f2c67 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -1472,7 +1472,7 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main) cpu_time_now = clib_cpu_time_now (); /* Pre-allocate interupt runtime indices and lock. */ - vec_alloc_aligned (nm->pending_interrupts, 1, CLIB_CACHE_LINE_BYTES); + vec_validate_aligned (nm->pending_interrupts, 0, CLIB_CACHE_LINE_BYTES); /* Pre-allocate expired nodes. */ if (!nm->polling_threshold_vector_length) -- 2.16.6