From d334a6b458e2ea60ee82b402d4785f5a2abc3c24 Mon Sep 17 00:00:00 2001 From: Eyal Bari Date: Mon, 19 Sep 2016 10:23:39 +0300 Subject: [PATCH] Added volatile to local variables needed by setjmp Function vlib_main uses nonlocal control transfer (setjmp, longjmp), local variables might be mapped to cpu registers which might be different when longjmp'ing back to it. Added volatile to keep those variables on the stack. to fix vpp crash when exiting via SIGTERM. Change-Id: I03e836966c68a966a84d635bc1f7b3a3c252f3ea Signed-off-by: Eyal Bari --- vlib/vlib/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/vlib/main.c b/vlib/vlib/main.c index c4062a7f333..809abdf5538 100644 --- a/vlib/vlib/main.c +++ b/vlib/vlib/main.c @@ -1569,9 +1569,9 @@ dummy_queue_signal_callback (vlib_main_t * vm) /* Main function. */ int -vlib_main (vlib_main_t * vm, unformat_input_t * input) +vlib_main (vlib_main_t * volatile vm, unformat_input_t * input) { - clib_error_t *error; + clib_error_t *volatile error; vm->queue_signal_callback = dummy_queue_signal_callback; -- 2.16.6