Added volatile to local variables needed by setjmp 34/2934/3
authorEyal Bari <ebari@cisco.com>
Mon, 19 Sep 2016 07:23:39 +0000 (10:23 +0300)
committerJohn Lo <loj@cisco.com>
Tue, 20 Sep 2016 16:24:53 +0000 (16:24 +0000)
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 <ebari@cisco.com>
vlib/vlib/main.c

index c4062a7..809abdf 100644 (file)
@@ -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;