qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Kauer <kauer@chrom.inf.tu-dresden.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Why not use exit() instead of abort()?
Date: Fri, 17 Aug 2007 18:45:52 +0200	[thread overview]
Message-ID: <20070817164552.GE15425@chrom.inf.tu-dresden.de> (raw)
In-Reply-To: <20070805215121.GB17778@erizo.shearer.org>

On Mon, Aug 06, 2007 at 07:21:21AM +0930, Dan Shearer wrote:
> On Sun, Aug 05, 2007 at 11:13:55PM +0200, Bernhard Kauer wrote:
> > 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. 
> 
> Tiny correction: abort() and _exit don't call atexit(), however
> unix-like OSs still cleanup memory and file descriptors and other
> transient resources  anyway no matter how the program ended. So lack of
> cleanup isn't quite as big an issue as it might seem.
> 
> > This leaves for example the terminal in a state where
> > the cursor is invisible.
> 
> Non-transient resources such as DSOs and domain sockets are not cleaned
> up by the OS, which accounts for the terminal problem you noticed.

Well, the problem is here that the function term_exit() is never
called, which would restore the terminal state to the old version
via a tcsetattr().


> > Are there any reasons not to use exit(1) in cpu_abort()?
> 
> Speed. I used to use abort() or _exit() for speed, ie they didn't hang
> around while atexit() waited politely for timeouts. I thought if I told
> the program to stop it should stop immediately :-)

I would use a 'kill -TERM' for that.


	Bernhard

      reply	other threads:[~2007-08-17 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-05 21:13 [Qemu-devel] Why not use exit() instead of abort()? Bernhard Kauer
2007-08-05 21:51 ` Dan Shearer
2007-08-17 16:45   ` Bernhard Kauer [this message]

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=20070817164552.GE15425@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).