From: Kevin Wolf <kwolf@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: armbru@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC 0/3] error: allow local errors to trigger abort
Date: Wed, 17 Jun 2015 16:29:41 +0200 [thread overview]
Message-ID: <20150617142941.GF4202@noname.str.redhat.com> (raw)
In-Reply-To: <55818392.60204@redhat.com>
Am 17.06.2015 um 16:26 hat John Snow geschrieben:
>
>
> On 06/16/2015 08:53 AM, Michael S. Tsirkin wrote:
> >
> > It's a common idiom:
> >
> > Error *local_err = NULL;
> > ....
> > foo(&local_err);
> > ...
> > if (local_err) {
> > error_propagate(errp, local_err);
> > return;
> > }
> >
> > Unfortunately it means that call to foo(&local_err) will
> > not abort even if errp is set to error_abort.
> >
> > Instead, we get an abort at error_propagate which is too late.
> >
>
> Please humor the ignorant: Why is this too late? Any code that does
> anything between foo(&local_err) and error_propagate is already broken.
The interesting part is the stack trace which is truncated if you
abort() only in the outermost caller.
Kevin
> > To fix, add an API to check errp and set local_err to error_abort
> > if errp is error_abort.
> >
> > Michael S. Tsirkin (3):
> > error: don't rely on pointer comparisons
> > error: allow local errors to trigger abort
> > block/nfs: switch to error_init_local
> >
> > include/qapi/error.h | 5 +++++
> > block/nfs.c | 2 +-
> > util/error.c | 21 ++++++++++++++++-----
> > 3 files changed, 22 insertions(+), 6 deletions(-)
> >
next prev parent reply other threads:[~2015-06-17 14:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 12:53 [Qemu-devel] [PATCH RFC 0/3] error: allow local errors to trigger abort Michael S. Tsirkin
2015-06-16 12:53 ` [Qemu-devel] [PATCH RFC 1/3] error: don't rely on pointer comparisons Michael S. Tsirkin
2015-06-16 14:45 ` Eric Blake
2015-06-16 14:49 ` Michael S. Tsirkin
2015-06-16 14:50 ` Eric Blake
2015-06-16 15:03 ` Eric Blake
2015-06-17 6:57 ` Michael S. Tsirkin
2015-06-17 9:11 ` Kevin Wolf
2015-06-16 12:53 ` [Qemu-devel] [PATCH RFC 2/3] error: allow local errors to trigger abort Michael S. Tsirkin
2015-06-16 15:06 ` Eric Blake
2015-06-16 12:53 ` [Qemu-devel] [PATCH RFC 3/3] block/nfs: switch to error_init_local Michael S. Tsirkin
2015-06-16 15:08 ` Eric Blake
2015-06-16 21:17 ` Michael S. Tsirkin
2015-06-17 14:26 ` [Qemu-devel] [PATCH RFC 0/3] error: allow local errors to trigger abort John Snow
2015-06-17 14:28 ` Michael S. Tsirkin
2015-06-17 14:29 ` Kevin Wolf [this message]
2015-06-17 14:30 ` John Snow
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=20150617142941.GF4202@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jsnow@redhat.com \
--cc=mst@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).