From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5EMk-0000c8-Bb for qemu-devel@nongnu.org; Wed, 17 Jun 2015 10:31:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5EMf-0008Hv-Cz for qemu-devel@nongnu.org; Wed, 17 Jun 2015 10:30:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5EMf-0008Hq-4t for qemu-devel@nongnu.org; Wed, 17 Jun 2015 10:30:53 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id C80CCB8BD8 for ; Wed, 17 Jun 2015 14:30:52 +0000 (UTC) Message-ID: <5581849B.60704@redhat.com> Date: Wed, 17 Jun 2015 10:30:51 -0400 From: John Snow MIME-Version: 1.0 References: <1434458200-23440-1-git-send-email-mst@redhat.com> <55818392.60204@redhat.com> <20150617142941.GF4202@noname.str.redhat.com> In-Reply-To: <20150617142941.GF4202@noname.str.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 0/3] error: allow local errors to trigger abort List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: armbru@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, "Michael S. Tsirkin" On 06/17/2015 10:29 AM, Kevin Wolf wrote: > 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 > AHHH, that makes sense now, thank you. >>> 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(-) >>>