From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSzsy-00017F-Pq for qemu-devel@nongnu.org; Tue, 12 Aug 2008 15:50:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSzsw-00014p-7W for qemu-devel@nongnu.org; Tue, 12 Aug 2008 15:50:27 -0400 Received: from [199.232.76.173] (port=47748 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSzsu-00014g-5U for qemu-devel@nongnu.org; Tue, 12 Aug 2008 15:50:24 -0400 Received: from wr-out-0506.google.com ([64.233.184.225]:28445) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSzst-0007ef-RI for qemu-devel@nongnu.org; Tue, 12 Aug 2008 15:50:23 -0400 Received: by wr-out-0506.google.com with SMTP id c46so2356586wra.18 for ; Tue, 12 Aug 2008 12:50:23 -0700 (PDT) Message-ID: <48A1E955.70406@codemonkey.ws> Date: Tue, 12 Aug 2008 14:49:41 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Handle terminating signals. References: <48A09722.3060106@redhat.com> <18593.24673.304649.806330@mariner.uk.xensource.com> <48A1D6A3.4050406@redhat.com> <20080812.132906.-399282484.imp@bsdimp.com> <48A1E78F.8000808@redhat.com> In-Reply-To: <48A1E78F.8000808@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Gerd Hoffmann wrote: > M. Warner Losh wrote: > >> In message: <48A1D6A3.4050406@redhat.com> >> Gerd Hoffmann writes: >> : > No, because the program should not attempt to catch SEGV either. >> : >> : Why not? Can you change your attitude to say "no" without giving >> : reasons please? >> >> The only portable thing one can do when catching SEGV is terminate the >> program. Otherwise, when the signal handler returns, SEGV happens >> again... >> > > Returning from the signal handler isn't going to work, sure. The only > thing I want do is cleaning up before exiting. > > Most apps never ever have to care about that. Sometimes there are good > reasons to attempt a cleanup even for a SEGV though. The X-Server for > example attempts to put the gfx card into a sane state then. > Note my previous suggestion of pipe() + fork() gives you the desired cleanup behaviour without having to deal with any of this silliness. IMHO, the real problem here is that Xen's domain-0 interface isn't based on file descriptors to begin with. What modern Linux interface that requires a clean-up action isn't, afterall? Regards, Anthony Liguori > cheers, > Gerd > >