From: Willem Pinckaers Date: Sat, 8 Nov 2014 03:51:59 +0000 (-0800) Subject: coroutine-sigaltstack: Change jmp_buf to sigjmp_buf X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7f151e6f718f2edaf8661c4dedf6fcdb30b10e1b;p=qmiga%2Fqemu.git coroutine-sigaltstack: Change jmp_buf to sigjmp_buf This is a simple patch to change the type of old_env from jmp_buf to sigjmp_buf. old_env is used by sigsetjmp and as such should be a sigjmp_buf. This fixes a stack_chk fail in a OSX 32bit build. Since at least on OSX sigjmp_buf is four bytes larger then a jmpbuf, resulting in an overflow in sigsetjmp. Due to variable reordering this overwrites the stack cookie. Signed-off-by: Willem Pinckaers Reviewed-by: Peter Maydell Peter: I think I must have missed this one when I converted all the jmp_buf to sigjmp_buf in commit 6ab7e546. Signed-off-by: Michael Tokarev --- diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c index 3de0bb33bd..63519fffc7 100644 --- a/coroutine-sigaltstack.c +++ b/coroutine-sigaltstack.c @@ -155,7 +155,7 @@ Coroutine *qemu_coroutine_new(void) stack_t oss; sigset_t sigs; sigset_t osigs; - jmp_buf old_env; + sigjmp_buf old_env; /* The way to manipulate stack is with the sigaltstack function. We * prepare a stack, with it delivering a signal to ourselves and then