From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35215 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q50S7-0007Ws-PD for qemu-devel@nongnu.org; Wed, 30 Mar 2011 14:49:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q50S6-0003Wi-IA for qemu-devel@nongnu.org; Wed, 30 Mar 2011 14:49:11 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:46888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q50S6-0003Wa-DG for qemu-devel@nongnu.org; Wed, 30 Mar 2011 14:49:10 -0400 Received: by iym10 with SMTP id 10so1809525iym.4 for ; Wed, 30 Mar 2011 11:49:09 -0700 (PDT) Message-ID: <4D937B26.3070906@codemonkey.ws> Date: Wed, 30 Mar 2011 13:49:10 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCHv3] report that QEMU process was killed by a signal References: <20110315115604.GY10151@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Gleb Natapov On 03/30/2011 01:39 PM, Peter Maydell wrote: > 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. Or just #ifdefing this to 0 for now and then once an SDL version is released that works correctly, adding an appropriate guard. Regards, Anthony Liguori > -- PMM >