From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrawZ-0008PA-7K for qemu-devel@nongnu.org; Tue, 16 Mar 2010 13:52:39 -0400 Received: from [199.232.76.173] (port=47661 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrawY-0008OV-OA for qemu-devel@nongnu.org; Tue, 16 Mar 2010 13:52:38 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NrawX-0005cy-Gn for qemu-devel@nongnu.org; Tue, 16 Mar 2010 13:52:38 -0400 Received: from mail2.shareable.org ([80.68.89.115]:58118) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NrawX-0005ci-6o for qemu-devel@nongnu.org; Tue, 16 Mar 2010 13:52:37 -0400 Date: Tue, 16 Mar 2010 17:52:34 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort() Message-ID: <20100316175234.GC19160@shareable.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini wrote: > 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. On Linux, man abort says: If the SIGABRT signal is ignored, or caught by a handler that returns, the abort() function will still terminate the process. It does this by restoring the default disposition for SIGABRT and then raising the sig‐ nal for a second time. However I have a suspicious that I've seen abort() return on some other OS in the distant past, maybe SunOS 4. I wouldn't rely on abort() always terminating the process on all OSes. -- Jamie