From: Blue Swirl <blauwirbel@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort()
Date: Mon, 15 Mar 2010 19:23:29 +0200 [thread overview]
Message-ID: <f43fc5581003151023g354dc74cr989f3373f5f1de9a@mail.gmail.com> (raw)
In-Reply-To: <m3sk82nj16.fsf@blackfin.pond.sub.org>
On 3/15/10, Markus Armbruster <armbru@redhat.com> wrote:
> Blue Swirl <blauwirbel@gmail.com> writes:
>
> > When building with -DNDEBUG, assert(0) will not stop execution
> > so it must not be used for abnormal termination.
>
>
> For each case: are you sure the code does not recover after assert(0)?
> Not saying it does, just asking whether you checked.
I had not checked but did just now,
QEMU system emulators do not handle SIGABRT. The situation is
different for user emulator, but then assert(0) and abort() would be
equally correct or incorrect.
> > Use cpu_abort() when in CPU context, abort() otherwise.
>
>
> I sympathize with the general idea, but I don't like dead code after
> abort(). What about cleaning that up?
Good idea, but it should be a separate patch. This patch is "safe",
whereas the cleanup patch could cause problems if it's not done
carefully.
next prev parent reply other threads:[~2010-03-15 17:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-13 14:56 [Qemu-devel] [PATCH, RFC] Replace assert(0) with abort() or cpu_abort() Blue Swirl
2010-03-13 15:43 ` Edgar E. Iglesias
2010-03-15 7:25 ` Markus Armbruster
2010-03-15 17:23 ` Blue Swirl [this message]
2010-03-15 18:19 ` [Qemu-devel] " Paolo Bonzini
2010-03-15 18:26 ` Blue Swirl
2010-03-15 18:33 ` Paolo Bonzini
2010-03-15 19:02 ` Blue Swirl
2010-03-15 18:28 ` Markus Armbruster
2010-03-15 18:36 ` [Qemu-devel] " Markus Armbruster
2010-03-16 8:24 ` [Qemu-devel] " Paolo Bonzini
2010-03-16 8:54 ` Markus Armbruster
2010-03-16 17:55 ` Jamie Lokier
2010-03-17 9:10 ` Paolo Bonzini
2010-03-17 19:50 ` Blue Swirl
2010-03-19 2:03 ` Jamie Lokier
2010-03-19 20:28 ` Blue Swirl
2010-03-18 8:36 ` Markus Armbruster
2010-03-16 17:52 ` Jamie Lokier
2010-03-16 18:35 ` Markus Armbruster
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=f43fc5581003151023g354dc74cr989f3373f5f1de9a@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=armbru@redhat.com \
--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).