From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IHnQo-0007T5-LA for qemu-devel@nongnu.org; Sun, 05 Aug 2007 17:14:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IHnQl-0007SO-1Z for qemu-devel@nongnu.org; Sun, 05 Aug 2007 17:14:33 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IHnQk-0007SL-SE for qemu-devel@nongnu.org; Sun, 05 Aug 2007 17:14:30 -0400 Received: from user-387go2v.cable.mindspring.com ([208.120.96.95] helo=chrom.inf.tu-dresden.de) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IHnQe-0006M7-2i for qemu-devel@nongnu.org; Sun, 05 Aug 2007 17:14:24 -0400 Received: from kauer by chrom.inf.tu-dresden.de with local (Exim 4.67) (envelope-from ) id 1IHnQC-0001bR-Qu for qemu-devel@nongnu.org; Sun, 05 Aug 2007 23:13:56 +0200 Date: Sun, 5 Aug 2007 23:13:55 +0200 From: Bernhard Kauer Message-ID: <20070805211355.GA2888@chrom.inf.tu-dresden.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ibTvN161/egqYuK8" Content-Disposition: inline Subject: [Qemu-devel] Why not use exit() instead of abort()? 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 --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline There are a couple of places in qemu, where abort() is called. The most commonly used one is perhaps cpu_abort() which is called e.g. when a triple fault occures. As abort() does not call any atexit() function, cleanup is not performed. This leaves for example the terminal in a state where the cursor is invisible. Are there any reasons not to use exit(1) in cpu_abort()? Bernhard Kauer --ibTvN161/egqYuK8 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="qemu_abort.diff" Index: exec.c =================================================================== RCS file: /sources/qemu/qemu/exec.c,v retrieving revision 1.103 diff -u -r1.103 exec.c --- exec.c 1 Jul 2007 18:21:11 -0000 1.103 +++ exec.c 4 Aug 2007 13:07:52 -0000 @@ -1301,7 +1301,7 @@ fflush(logfile); fclose(logfile); } - abort(); + exit(1); } CPUState *cpu_copy(CPUState *env) --ibTvN161/egqYuK8--