qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] qemu on MacOS, failing to respond to ctrl-C


From: Peter Maydell
Subject: Re: [Qemu-devel] qemu on MacOS, failing to respond to ctrl-C
Date: Mon, 18 Feb 2013 19:29:50 +0000

On 18 February 2013 18:30, Laszlo Ersek <address@hidden> wrote:
> On 02/17/13 01:59, Peter Maydell wrote:
>> On 17 February 2013 00:19, Peter Maydell <address@hidden> wrote:
>> Found it! The culprit is the setjmp/longjmp in cpu-exec.c.
>> On Linux these don't save and restore the process signal mask
>> (you use sigsetjmp/siglongjmp for that). However on BSD setjmp
>> and longjmp do save and restore the process signal mask, so
>> when we do the longjmp in the CPU thread we end up setting the
>> mask for every thread to the restrictive mask used by the
>> CPU thread. Then SIGTERM and SIGINT are blocked for every
>> thread and have no effect on QEMU.
>
> This is a bug in MacOSX. In POSIX there's no such thing as "whole
> process signal mask". Signal *actions* are process-wide, signal *masks*
> are always thread-specific.

Ah, yes, you're right. This is probably why we don't see a problem
on {Free,Net,Open}BSD hosts (at least I assume Blue Swirl would
have noticed if ctrl-c didn't work there).

> However I agree that your fix / workaround for the problem is likely
> appropriate.

Yes, we don't want to mess with the masks anyway (if nothing else,
it slows us down and makes the behaviour inconsistent between
host OSes, neither of which are good ideas).

-- PMM



reply via email to

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