From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43619 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q50In-0000dm-AQ for qemu-devel@nongnu.org; Wed, 30 Mar 2011 14:39:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q50Im-0001wS-A5 for qemu-devel@nongnu.org; Wed, 30 Mar 2011 14:39:33 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:37926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q50Im-0001wM-6l for qemu-devel@nongnu.org; Wed, 30 Mar 2011 14:39:32 -0400 Received: by vxb41 with SMTP id 41so1434773vxb.4 for ; Wed, 30 Mar 2011 11:39:31 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20110315115604.GY10151@redhat.com> References: <20110315115604.GY10151@redhat.com> Date: Wed, 30 Mar 2011 19:39:31 +0100 Message-ID: Subject: Re: [Qemu-devel] [PATCHv3] report that QEMU process was killed by a signal From: Peter Maydell Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org On 15 March 2011 11:56, Gleb Natapov wrote: > Currently when rogue script kills QEMU process (using TERM/INT/HUP > signal) it looks indistinguishable from system shutdown. Lets report > that QEMU was killed and leave some clues about the killer identity. Unfortunately this patch causes qemu to segfault when killed via ^C (at least on my Ubuntu maverick system). This is because it registers a signal handler with sigaction, but then later the SDL library is initialised and it reinstalls our handler with plain old signal: ohandler = signal(SIGINT, SDL_HandleSIG); if ( ohandler != SIG_DFL ) signal(SIGINT, ohandler); This is clearly buggy but on the other hand SDL is pretty widely deployed and it's the default QEMU video output method, so I think we need to work around it :-( The most straightforward fix is to get the signal number from argument one and not to bother printing the PID that killed us. -- PMM