From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrazH-0003L5-2Z for qemu-devel@nongnu.org; Tue, 16 Mar 2010 13:55:27 -0400 Received: from [199.232.76.173] (port=47699 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrazG-0003KG-Ge for qemu-devel@nongnu.org; Tue, 16 Mar 2010 13:55:26 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NrazF-0005nj-6b for qemu-devel@nongnu.org; Tue, 16 Mar 2010 13:55:26 -0400 Received: from mail2.shareable.org ([80.68.89.115]:58136) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NrazE-0005nf-TZ for qemu-devel@nongnu.org; Tue, 16 Mar 2010 13:55:25 -0400 Date: Tue, 16 Mar 2010 17:55:23 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort() Message-ID: <20100316175523.GD19160@shareable.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Paolo Bonzini , qemu-devel@nongnu.org Markus Armbruster wrote: > Paolo Bonzini writes: > > > On 03/15/2010 07:36 PM, Markus Armbruster wrote: > >> Please don't tell me that user emulators make abort() return. abort() > >> is declared __noreturn__, and the optimizer may well rely on that. > > > > If the user programs make a "signal (SIGABRT, SIG_IGN)" call, I > > suppose abort() will return. > > I program doing that gets what it asks for, and richly deserves. A guest program is also allowed to trap SIGABRT with a signal handler, and that does have some uses. E.g. cleaning up temporary files and shmem segments following a crash when calling 3rd party code. Whatever the guest does with SIGABRT, it should not result in _QEMU_ crashing - whether due to abort() returning, or QEMU's control flow jumping to the guest's signal handler from an unexpected location. -- Jamie