qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Use special code for sigsetjmp only in cpu-exec


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] Use special code for sigsetjmp only in cpu-exec.c
Date: Tue, 1 Mar 2016 12:22:51 +0000

On 1 March 2016 at 11:54, Stefan Weil <address@hidden> wrote:
> Am 01.03.2016 um 10:59 schrieb Peter Maydell:
>> I don't understand this patch. Why doesn't it work to have
>> sigsetjmp() be implemented the same way for every use that
>> QEMU makes of it?

> It does, as long as the "same way" is the correct one, namely
> the one without stack unwinding.
>
> The current code used to work, but re-arranged include files
> broke the working code somewhere in the past:
>
> include/sysemu/os-win32.h does the right thing at the
> wrong place. Its correct definition of sigsetjmp is overwritten by
> the definition from a Mingw-w64 system header file which
> triggers stack unwinding. Stack unwinding is fatal for
> QEMU's generated code.
>
> My patch makes sure that the critical code in cpu-exec.c
> gets the correct definition of sigsetjmp.

I think we should fix this by making sure that osdep.h
does the right thing -- ie that it gives us the correct
definition and prevents mingw's headers from overriding it
with the wrong thing (by ensuring that the offending system
header is included before we redefine things, or however
necessary). This is what osdep.h's purpose is -- to hide
annoying system-header workarounds and hacks rather than
putting them in the rest of QEMU code.

> In addition, it removes code which might or might not
> change the default definition of sigsetjmp (depending
> on the order of include files). Now all other files beside
> cpu-exec.c will use the default behaviour with stack
> unwinding.

That seems wrong -- we should have the same behaviour for
sigsetjmp/siglongjmp everywhere we use it.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]