From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfvaB-0004qs-DY for qemu-devel@nongnu.org; Mon, 11 Nov 2013 12:47:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vfva5-00080Z-8p for qemu-devel@nongnu.org; Mon, 11 Nov 2013 12:47:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vfva5-00080P-12 for qemu-devel@nongnu.org; Mon, 11 Nov 2013 12:47:21 -0500 Message-ID: <52811822.6040401@redhat.com> Date: Mon, 11 Nov 2013 18:47:14 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <52810AEA.5020806@redhat.com> <52810E6F.1010505@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] audit needed for signal handlers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "qemu-devel@nongnu.org" , Anthony Liguori Il 11/11/2013 18:13, Peter Maydell ha scritto: >> > That said, aren't all signals in QEMU (except SIG_IPI) caught with >> > signalfd and the handlers run synchronously in the iothread? > Eric specifically points out one which is not. > (I'm pretty sure that 'reinstall signal handler at > end of signal handler' is ancient voodoo that we don't > want either, incidentally.) Yeah, I was convinced it was---I still cannot find a reason why SIGWINCH needs to be handled synchronously. resize_term is definitely not signal safe; the man page reflects 10-year-old (or more) signal handling lore: "While these functions are intended to be used to support a signal handler (i.e., for SIGWINCH), care should be taken to avoid invoking them in a context where malloc or realloc may have been interrupted, since it uses those functions". Calling malloc/realloc from a signal handler is taboo these days... Paolo