There appears to be a race condition when SIGUSR2 is not handled synchronously by the signalfd thread. This caused random freezes/segfaults under OS X.
This fix also appears to fix most of the I/O errors that occur when the io-thread is enabled on OS X. Signed-off-by: Alexandre Raymond <cerb...@gmail.com> --- cpus.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index 3035314..f466d95 100644 --- a/cpus.c +++ b/cpus.c @@ -391,10 +391,6 @@ static int qemu_signal_init(void) sigset_t set; #ifdef CONFIG_IOTHREAD - /* SIGUSR2 used by posix-aio-compat.c */ - sigemptyset(&set); - sigaddset(&set, SIGUSR2); - pthread_sigmask(SIG_UNBLOCK, &set, NULL); /* * SIG_IPI must be blocked in the main thread and must not be caught @@ -406,11 +402,13 @@ static int qemu_signal_init(void) pthread_sigmask(SIG_BLOCK, &set, NULL); sigemptyset(&set); + sigaddset(&set, SIGUSR2); sigaddset(&set, SIGIO); sigaddset(&set, SIGALRM); sigaddset(&set, SIGBUS); #else sigemptyset(&set); + sigaddset(&set, SIGUSR2); sigaddset(&set, SIGBUS); if (kvm_enabled()) { /* -- 1.7.5