From: Bernhard Kauer <kauer@chrom.inf.tu-dresden.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Why not use exit() instead of abort()?
Date: Sun, 5 Aug 2007 23:13:55 +0200 [thread overview]
Message-ID: <20070805211355.GA2888@chrom.inf.tu-dresden.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 393 bytes --]
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
[-- Attachment #2: qemu_abort.diff --]
[-- Type: text/x-diff, Size: 398 bytes --]
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)
next reply other threads:[~2007-08-05 21:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-05 21:13 Bernhard Kauer [this message]
2007-08-05 21:51 ` [Qemu-devel] Why not use exit() instead of abort()? Dan Shearer
2007-08-17 16:45 ` Bernhard Kauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070805211355.GA2888@chrom.inf.tu-dresden.de \
--to=kauer@chrom.inf.tu-dresden.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).