From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1idEPH-0002PY-VH for mharc-qemu-riscv@gnu.org; Fri, 06 Dec 2019 09:16:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35549) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idEP9-0002Ht-PJ for qemu-riscv@nongnu.org; Fri, 06 Dec 2019 09:16:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idEP7-0002l5-Fv for qemu-riscv@nongnu.org; Fri, 06 Dec 2019 09:16:23 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:42190 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1idEP7-0002hP-8K for qemu-riscv@nongnu.org; Fri, 06 Dec 2019 09:16:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575641773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QydCtaGu0VxNLL1vkJgck5UBv6FIuo7+xYoT62obZJU=; b=WNuPiCVFqtykdArdtsfKsuIY130OeRw9Q16csGfmLPUU3DG0XYUTGs5Clgb4OLG88Anakw bz3xRoryi2HKw0K2w7UVZuZ+9moEcAfKm47Q7xWfxW6P9pJ21Q1u+u9GxWMKtqugRQadKe yMD1Yxu6e2iC4TjlKkzgwfBK1f3P1eI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-348-Ywo88t0dNVOFL__UeWWsrg-1; Fri, 06 Dec 2019 03:14:29 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34BFA102CE28; Fri, 6 Dec 2019 08:14:25 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-134.ams2.redhat.com [10.36.116.134]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2D8819C7F; Fri, 6 Dec 2019 08:13:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 22B421138606; Fri, 6 Dec 2019 09:13:57 +0100 (CET) From: Markus Armbruster To: Vladimir Sementsov-Ogievskiy Cc: Stefan Hajnoczi , Jeff Cody , Jan Kiszka , Alberto Garcia , Hailiang Zhang , "qemu-block\@nongnu.org" , Aleksandar Rikalo , Halil Pasic , =?utf-8?Q?Herv=C3=A9?= Poussineau , Anthony Perard , Samuel Thibault , Laszlo Ersek , Jason Wang , Laurent Vivier , Eduardo Habkost , Xie Changlong , Peter Lieven , "Dr. David Alan Gilbert" , Beniamino Galvani , Eric Auger , Alex Williamson , Ronnie Sahlberg , John Snow , Richard Henderson , Kevin Wolf , Andrew Jeffery , Chris Wulff , Subbaraya Sundeep , Michael Walle , "qemu-ppc\@nongnu.org" , Bastian Koppelmann , Igor Mammedov , Fam Zheng , Peter Maydell , "sheepdog\@lists.wpkg.org" , Matthew Rosato , David Hildenbrand , Palmer Dabbelt , Eric Farman , Max Filippov , Hannes Reinecke , Stefano Stabellini , "Gonglei \(Arei\)" , Liu Yuan , Artyom Tarasenko , Thomas Huth , Amit Shah , Stefan Weil , Greg Kurz , Yuval Shaia , "qemu-s390x\@nongnu.org" , "qemu-arm\@nongnu.org" , Peter Chubb , =?utf-8?Q?C=C3=A9dric?= Le Goater , Stafford Horne , "qemu-riscv\@nongnu.org" , Cornelia Huck , Aleksandar Markovic , Aurelien Jarno , Paul Burton , Sagar Karandikar , Paul Durrant , Anthony Green , Gerd Hoffmann , "Edgar E. Iglesias" , Guan Xuetao , Ari Sundholm , Juan Quintela , Michael Roth , Christian Borntraeger , Joel Stanley , Jason Dillaman , Antony Pavlov , "xen-devel\@lists.xenproject.org" , "integration\@gluster.org" , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , "Richard W.M. Jones" , Andrew Baumann , Max Reitz , Denis Lunev , "Michael S. Tsirkin" , Mark Cave-Ayland , "qemu-devel\@nongnu.org" , Vincenzo Maffione , Marek Vasut , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Alistair Francis , Pavel Dovgalyuk , Giuseppe Lettieri , Luigi Rizzo , David Gibson , Tony Krowiak , Daniel P. =?utf-8?Q?Berrang=C3=A9?= , Xiao Guangrong , Pierre Morel , Wen Congyang , Jean-Christophe Dubois , Paolo Bonzini , Stefan Berger Subject: Re: [RFC v5 024/126] error: auto propagated local_err References: <20191011160552.22907-1-vsementsov@virtuozzo.com> <20191011160552.22907-25-vsementsov@virtuozzo.com> <87muc8p24w.fsf@dusky.pond.sub.org> <55393c08-5bda-8042-1a95-f350b3781d99@virtuozzo.com> <87d0d3c5k7.fsf@dusky.pond.sub.org> Date: Fri, 06 Dec 2019 09:13:57 +0100 In-Reply-To: (Vladimir Sementsov-Ogievskiy's message of "Thu, 5 Dec 2019 16:36:42 +0000") Message-ID: <87h82dna62.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: Ywo88t0dNVOFL__UeWWsrg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2019 14:16:27 -0000 Vladimir Sementsov-Ogievskiy writes: > 05.12.2019 17:58, Vladimir Sementsov-Ogievskiy wrote: >> 05.12.2019 15:36, Markus Armbruster wrote: >>> Vladimir Sementsov-Ogievskiy writes: >>> >>>> 04.12.2019 17:59, Markus Armbruster wrote: >>>>> Vladimir Sementsov-Ogievskiy writes: >>>>> >>>>>> Here is introduced ERRP_AUTO_PROPAGATE macro, to be used at start of >>>>>> functions with errp OUT parameter. >>>>>> >>>>>> It has three goals: >>>>>> >>>>>> 1. Fix issue with error_fatal & error_prepend/error_append_hint: use= r >>>>>> can't see this additional information, because exit() happens in >>>>>> error_setg earlier than information is added. [Reported by Greg Kurz= ] >>>>>> >>>>>> 2. Fix issue with error_abort & error_propagate: when we wrap >>>>>> error_abort by local_err+error_propagate, resulting coredump will >>>>>> refer to error_propagate and not to the place where error happened. >>>>> >>>>> I get what you mean, but I have plenty of context. >>>>> >>>>>> (the macro itself doesn't fix the issue, but it allows to [3.] drop = all >>>>>> local_err+error_propagate pattern, which will definitely fix the iss= ue) >>>>> >>>>> The parenthesis is not part of the goal. >>>>> >>>>>> [Reported by Kevin Wolf] >>>>>> >>>>>> 3. Drop local_err+error_propagate pattern, which is used to workarou= nd >>>>>> void functions with errp parameter, when caller wants to know result= ing >>>>>> status. (Note: actually these functions could be merely updated to >>>>>> return int error code). >>>>>> >>>>>> To achieve these goals, we need to add invocation of the macro at st= art >>>>>> of functions, which needs error_prepend/error_append_hint (1.); add >>>>>> invocation of the macro at start of functions which do >>>>>> local_err+error_propagate scenario the check errors, drop local erro= rs >>>>>> from them and just use *errp instead (2., 3.). >>>>> >>>>> The paragraph talks about two cases: 1. and 2.+3. >>>> >>>> Hmm, I don't think so.. 1. and 2. are issues. 3. is a refactoring.. We= just >>>> fix achieve 2 and 3 by one action. >>>> >>>>> Makes me think we >>>>> want two paragraphs, each illustrated with an example. >>>>> >>>>> What about you provide the examples, and then I try to polish the pro= se? >>>> >>>> 1: error_fatal problem >>>> >>>> Assume the following code flow: >>>> >>>> int f1(errp) { >>>> ... >>>> ret =3D f2(errp); >>>> if (ret < 0) { >>>> error_append_hint(errp, "very useful hint"); >>>> return ret; >>>> } >>>> ... >>>> } >>>> >>>> Now, if we call f1 with &error_fatal argument and f2 fails, the progra= m >>>> will exit immediately inside f2, when setting the errp. User will not >>>> see the hint. >>>> >>>> So, in this case we should use local_err. >>> >>> How does this example look after the transformation? >>=20 >> Good point. >>=20 >> int f1(errp) { >> ERRP_AUTO_PROPAGATE(); >> ... >> ret =3D f2(errp); >> if (ret < 0) { >> error_append_hint(errp, "very useful hint"); >> return ret; >> } >> ... >> } >>=20 >> - nothing changed, only add macro at start. But now errp is safe, if it = was >> error_fatal it is wrapped by local error, and will only call exit on aut= omatic >> propagation on f1 finish. >>=20 >>> >>>> 2: error_abort problem >>>> >>>> Now, consider functions without return value. We normally use local_er= r >>>> variable to catch failures: >>>> >>>> void f1(errp) { >>>> Error *local_err =3D NULL; >>>> ... >>>> f2(&local_err); >>>> if (local_err) { >>>> error_propagate(errp, local_err); >>>> return; >>>> } >>>> ... >>>> } >>>> >>>> Now, if we call f2 with &error_abort and f2 fails, the stack in result= ing >>>> crash dump will point to error_propagate, not to the failure point in = f2, >>>> which complicates debugging. >>>> >>>> So, we should never wrap error_abort by local_err. >>> >>> Likewise. >>=20 >> And here: >>=20 >> void f1(errp) { >> ERRP_AUTO_PROPAGATE(); >> ... >> f2(errp); >> if (*errp) { >> return; >> } >> ... >>=20 >> - if errp was NULL, it is wrapped, so dereferencing errp is safe. On ret= urn, >> local error is automatically propagated to original one. > > and if it was error_abort, it is not wrapped, so will crash where failed. We still need to avoid passing on unwrapped @errp when we want to ignore some errors, as in fit_load_fdt(), but that should be quite rare. Doesn't invalidate your approach. [...] From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:c345:0:0:0:0:0 with SMTP id t66csp834516lff; Fri, 6 Dec 2019 06:42:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxRHIhs85tnVpoJ1n8G++YJKfP1jhW1DlRbM7FPr5xUc8pgGq8ECO0lBjdWgu+juAI/OnaY X-Received: by 2002:aca:570f:: with SMTP id l15mr12819462oib.120.1575643352334; Fri, 06 Dec 2019 06:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575643352; cv=none; d=google.com; s=arc-20160816; b=O3PT2payRaPvi2bsEQUuy9+0SmiVQhZsQj4uJ4WtNKukmHOOTQdQmoId7vqURI+ETe NJrjwWbeVF9O2LNOI1tMralFRfCHqlqkeFGzGVbsXdxc/cjYRdzMVRyy8pHH4JTsat+U vFPAPeQdm/LgN3QUMm8f5mSx8XThnxWL0+/ABPacKmU3ekV8+RBQMkjrMAMzpJLEdVFj fUdSX3O7leb/Kf9h/YhNshks4arVMhNCg0+9TotodxZjfAjagoDsYmu/XK75gsV0ZXNe pfv8IP6epA0z5b61Pgu1Tt78h2sh1MO++iJ34NvQ1bHRqGO92T/0RfFxL7uK3IIqYhRG 2/2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:message-id:in-reply-to:date:references :subject:to:from:dkim-signature; bh=QydCtaGu0VxNLL1vkJgck5UBv6FIuo7+xYoT62obZJU=; b=FuVOSWFxt5r8+rs9Z31+AX2yRUxK3/AoyL1bgNLJrViOu5V7UXJozLOUErX+S9ylTI +KRPRdTJpm1AQBi0Nue6aRY31pM9Mn/Wl1lB8nRkuoBA3zHL8Y6HcMQMZKQsRjTn/Bp/ KDiql2cS4Fy9XqlDSh+JBeKtZrjJbsDlGyRAiFGJ1psO0/LljE9qlTyw/dniE4vkbBSn 4/FmSgAT0wv0qRUz+Kb60R0AXkZ3nIFWtxn4MHNO99bNzTsaZeTuyYccPtJTJ1CbfLc/ tMIR+ZVnxb53y18R06rQWLjKCtSvh3K2dyqJ6p9mpBkYQl145NwP4p+pTSZB9sb56arZ QrfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=WNuPiCVF; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c24si739223otf.14.2019.12.06.06.42.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Dec 2019 06:42:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=WNuPiCVF; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:38806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idEoR-0002Uw-3k for alex.bennee@linaro.org; Fri, 06 Dec 2019 09:42:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35534) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idEP9-0002Hq-Ps for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:16:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idEP7-0002m1-LM for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:16:23 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:55767 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1idEP7-0002hD-Eo for qemu-devel@nongnu.org; Fri, 06 Dec 2019 09:16:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575641773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QydCtaGu0VxNLL1vkJgck5UBv6FIuo7+xYoT62obZJU=; b=WNuPiCVFqtykdArdtsfKsuIY130OeRw9Q16csGfmLPUU3DG0XYUTGs5Clgb4OLG88Anakw bz3xRoryi2HKw0K2w7UVZuZ+9moEcAfKm47Q7xWfxW6P9pJ21Q1u+u9GxWMKtqugRQadKe yMD1Yxu6e2iC4TjlKkzgwfBK1f3P1eI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-348-Ywo88t0dNVOFL__UeWWsrg-1; Fri, 06 Dec 2019 03:14:29 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34BFA102CE28; Fri, 6 Dec 2019 08:14:25 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-134.ams2.redhat.com [10.36.116.134]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2D8819C7F; Fri, 6 Dec 2019 08:13:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 22B421138606; Fri, 6 Dec 2019 09:13:57 +0100 (CET) From: Markus Armbruster To: Vladimir Sementsov-Ogievskiy Subject: Re: [RFC v5 024/126] error: auto propagated local_err References: <20191011160552.22907-1-vsementsov@virtuozzo.com> <20191011160552.22907-25-vsementsov@virtuozzo.com> <87muc8p24w.fsf@dusky.pond.sub.org> <55393c08-5bda-8042-1a95-f350b3781d99@virtuozzo.com> <87d0d3c5k7.fsf@dusky.pond.sub.org> Date: Fri, 06 Dec 2019 09:13:57 +0100 In-Reply-To: (Vladimir Sementsov-Ogievskiy's message of "Thu, 5 Dec 2019 16:36:42 +0000") Message-ID: <87h82dna62.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: Ywo88t0dNVOFL__UeWWsrg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Hajnoczi , Jeff Cody , Jan Kiszka , Alberto Garcia , Hailiang Zhang , "qemu-block@nongnu.org" , Aleksandar Rikalo , Halil Pasic , =?utf-8?Q?Herv=C3=A9?= Poussineau , Anthony Perard , Samuel Thibault , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Anthony Green , Laurent Vivier , Eduardo Habkost , Xie Changlong , Peter Lieven , "Dr. David Alan Gilbert" , Beniamino Galvani , Eric Auger , Alex Williamson , Ronnie Sahlberg , John Snow , Richard Henderson , Kevin Wolf , Andrew Jeffery , Chris Wulff , Subbaraya Sundeep , Michael Walle , "qemu-ppc@nongnu.org" , Bastian Koppelmann , Igor Mammedov , Fam Zheng , Peter Maydell , "sheepdog@lists.wpkg.org" , Matthew Rosato , David Hildenbrand , Palmer Dabbelt , Eric Farman , Max Filippov , Hannes Reinecke , Stefano Stabellini , "Gonglei \(Arei\)" , Liu Yuan , Artyom Tarasenko , Thomas Huth , Amit Shah , Stefan Weil , Greg Kurz , Yuval Shaia , "qemu-s390x@nongnu.org" , "qemu-arm@nongnu.org" , Peter Chubb , =?utf-8?Q?C=C3=A9dric?= Le Goater , Stafford Horne , "qemu-riscv@nongnu.org" , Cornelia Huck , Aleksandar Markovic , Aurelien Jarno , Paul Burton , Sagar Karandikar , Paul Durrant , Jason Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Guan Xuetao , Ari Sundholm , Juan Quintela , Michael Roth , Christian Borntraeger , Joel Stanley , Jason Dillaman , Antony Pavlov , "xen-devel@lists.xenproject.org" , "integration@gluster.org" , Laszlo Ersek , "Richard W.M. Jones" , Andrew Baumann , Max Reitz , Denis Lunev , "Michael S. Tsirkin" , Mark Cave-Ayland , "qemu-devel@nongnu.org" , Vincenzo Maffione , Marek Vasut , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Alistair Francis , Pavel Dovgalyuk , Giuseppe Lettieri , Luigi Rizzo , David Gibson , Tony Krowiak , "Daniel P. =?utf-8?Q?Berrang=C3=A9?=" , Xiao Guangrong , Pierre Morel , Wen Congyang , Jean-Christophe Dubois , Paolo Bonzini , Stefan Berger Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-devel" X-TUID: htLtIPQyafG6 Vladimir Sementsov-Ogievskiy writes: > 05.12.2019 17:58, Vladimir Sementsov-Ogievskiy wrote: >> 05.12.2019 15:36, Markus Armbruster wrote: >>> Vladimir Sementsov-Ogievskiy writes: >>> >>>> 04.12.2019 17:59, Markus Armbruster wrote: >>>>> Vladimir Sementsov-Ogievskiy writes: >>>>> >>>>>> Here is introduced ERRP_AUTO_PROPAGATE macro, to be used at start of >>>>>> functions with errp OUT parameter. >>>>>> >>>>>> It has three goals: >>>>>> >>>>>> 1. Fix issue with error_fatal & error_prepend/error_append_hint: use= r >>>>>> can't see this additional information, because exit() happens in >>>>>> error_setg earlier than information is added. [Reported by Greg Kurz= ] >>>>>> >>>>>> 2. Fix issue with error_abort & error_propagate: when we wrap >>>>>> error_abort by local_err+error_propagate, resulting coredump will >>>>>> refer to error_propagate and not to the place where error happened. >>>>> >>>>> I get what you mean, but I have plenty of context. >>>>> >>>>>> (the macro itself doesn't fix the issue, but it allows to [3.] drop = all >>>>>> local_err+error_propagate pattern, which will definitely fix the iss= ue) >>>>> >>>>> The parenthesis is not part of the goal. >>>>> >>>>>> [Reported by Kevin Wolf] >>>>>> >>>>>> 3. Drop local_err+error_propagate pattern, which is used to workarou= nd >>>>>> void functions with errp parameter, when caller wants to know result= ing >>>>>> status. (Note: actually these functions could be merely updated to >>>>>> return int error code). >>>>>> >>>>>> To achieve these goals, we need to add invocation of the macro at st= art >>>>>> of functions, which needs error_prepend/error_append_hint (1.); add >>>>>> invocation of the macro at start of functions which do >>>>>> local_err+error_propagate scenario the check errors, drop local erro= rs >>>>>> from them and just use *errp instead (2., 3.). >>>>> >>>>> The paragraph talks about two cases: 1. and 2.+3. >>>> >>>> Hmm, I don't think so.. 1. and 2. are issues. 3. is a refactoring.. We= just >>>> fix achieve 2 and 3 by one action. >>>> >>>>> Makes me think we >>>>> want two paragraphs, each illustrated with an example. >>>>> >>>>> What about you provide the examples, and then I try to polish the pro= se? >>>> >>>> 1: error_fatal problem >>>> >>>> Assume the following code flow: >>>> >>>> int f1(errp) { >>>> ... >>>> ret =3D f2(errp); >>>> if (ret < 0) { >>>> error_append_hint(errp, "very useful hint"); >>>> return ret; >>>> } >>>> ... >>>> } >>>> >>>> Now, if we call f1 with &error_fatal argument and f2 fails, the progra= m >>>> will exit immediately inside f2, when setting the errp. User will not >>>> see the hint. >>>> >>>> So, in this case we should use local_err. >>> >>> How does this example look after the transformation? >>=20 >> Good point. >>=20 >> int f1(errp) { >> ERRP_AUTO_PROPAGATE(); >> ... >> ret =3D f2(errp); >> if (ret < 0) { >> error_append_hint(errp, "very useful hint"); >> return ret; >> } >> ... >> } >>=20 >> - nothing changed, only add macro at start. But now errp is safe, if it = was >> error_fatal it is wrapped by local error, and will only call exit on aut= omatic >> propagation on f1 finish. >>=20 >>> >>>> 2: error_abort problem >>>> >>>> Now, consider functions without return value. We normally use local_er= r >>>> variable to catch failures: >>>> >>>> void f1(errp) { >>>> Error *local_err =3D NULL; >>>> ... >>>> f2(&local_err); >>>> if (local_err) { >>>> error_propagate(errp, local_err); >>>> return; >>>> } >>>> ... >>>> } >>>> >>>> Now, if we call f2 with &error_abort and f2 fails, the stack in result= ing >>>> crash dump will point to error_propagate, not to the failure point in = f2, >>>> which complicates debugging. >>>> >>>> So, we should never wrap error_abort by local_err. >>> >>> Likewise. >>=20 >> And here: >>=20 >> void f1(errp) { >> ERRP_AUTO_PROPAGATE(); >> ... >> f2(errp); >> if (*errp) { >> return; >> } >> ... >>=20 >> - if errp was NULL, it is wrapped, so dereferencing errp is safe. On ret= urn, >> local error is automatically propagated to original one. > > and if it was error_abort, it is not wrapped, so will crash where failed. We still need to avoid passing on unwrapped @errp when we want to ignore some errors, as in fit_load_fdt(), but that should be quite rare. Doesn't invalidate your approach. [...] From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 949CAC43603 for ; Fri, 6 Dec 2019 10:20:01 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5924621823 for ; Fri, 6 Dec 2019 10:20:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dMrCNcrN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5924621823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1idAiE-0003E0-3o; Fri, 06 Dec 2019 10:19:50 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1id8ki-00016S-HD for xen-devel@lists.xenproject.org; Fri, 06 Dec 2019 08:14:16 +0000 X-Inumbo-ID: 6438cc07-1800-11ea-824b-12813bfff9fa Received: from us-smtp-delivery-1.mimecast.com (unknown [207.211.31.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 6438cc07-1800-11ea-824b-12813bfff9fa; Fri, 06 Dec 2019 08:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575620054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QydCtaGu0VxNLL1vkJgck5UBv6FIuo7+xYoT62obZJU=; b=dMrCNcrNIVOi3/5hxgXyr76R6JlPf5O90wpL7h5vjYKKJva8i1GQbPem2xnPebOsyzM45g qhzAAJQuiOnQ10YEaQuqbw9q+S8Sa2oaG5bX/ndjVMbDpFy9f5VS4V8UBCcjbNvHnERxxS UjaGnfZTF4T7Suy00DYJiheoarS9Zqs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-W0n4kzfiMeKW3rQCHhbFpA-1; Fri, 06 Dec 2019 03:14:11 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 18DE2107ACC7; Fri, 6 Dec 2019 08:14:03 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-134.ams2.redhat.com [10.36.116.134]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A48DE60143; Fri, 6 Dec 2019 08:13:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 22B421138606; Fri, 6 Dec 2019 09:13:57 +0100 (CET) From: Markus Armbruster To: Vladimir Sementsov-Ogievskiy References: <20191011160552.22907-1-vsementsov@virtuozzo.com> <20191011160552.22907-25-vsementsov@virtuozzo.com> <87muc8p24w.fsf@dusky.pond.sub.org> <55393c08-5bda-8042-1a95-f350b3781d99@virtuozzo.com> <87d0d3c5k7.fsf@dusky.pond.sub.org> Date: Fri, 06 Dec 2019 09:13:57 +0100 In-Reply-To: (Vladimir Sementsov-Ogievskiy's message of "Thu, 5 Dec 2019 16:36:42 +0000") Message-ID: <87h82dna62.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: W0n4kzfiMeKW3rQCHhbFpA-1 X-Mimecast-Spam-Score: 0 X-Mailman-Approved-At: Fri, 06 Dec 2019 10:19:49 +0000 Subject: Re: [Xen-devel] [RFC v5 024/126] error: auto propagated local_err X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefan Hajnoczi , Jeff Cody , Jan Kiszka , Alberto Garcia , Hailiang Zhang , "qemu-block@nongnu.org" , Aleksandar Rikalo , Halil Pasic , =?utf-8?Q?Herv=C3=A9?= Poussineau , Anthony Perard , Samuel Thibault , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Anthony Green , Laurent Vivier , Eduardo Habkost , Xie Changlong , Peter Lieven , "Dr. David Alan Gilbert" , Beniamino Galvani , Eric Auger , Alex Williamson , Ronnie Sahlberg , John Snow , Richard Henderson , Kevin Wolf , Andrew Jeffery , Chris Wulff , Subbaraya Sundeep , Michael Walle , "qemu-ppc@nongnu.org" , Bastian Koppelmann , Igor Mammedov , Fam Zheng , Peter Maydell , "sheepdog@lists.wpkg.org" , Matthew Rosato , David Hildenbrand , Palmer Dabbelt , Eric Farman , Max Filippov , Hannes Reinecke , Stefano Stabellini , "Gonglei \(Arei\)" , Liu Yuan , Artyom Tarasenko , Thomas Huth , Amit Shah , Stefan Weil , Greg Kurz , Yuval Shaia , "qemu-s390x@nongnu.org" , "qemu-arm@nongnu.org" , Peter Chubb , =?utf-8?Q?C=C3=A9dric?= Le Goater , Stafford Horne , "qemu-riscv@nongnu.org" , Cornelia Huck , Aleksandar Markovic , Aurelien Jarno , Paul Burton , Sagar Karandikar , Paul Durrant , Jason Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Guan Xuetao , Ari Sundholm , Juan Quintela , Michael Roth , Christian Borntraeger , Joel Stanley , Jason Dillaman , Antony Pavlov , "xen-devel@lists.xenproject.org" , "integration@gluster.org" , Laszlo Ersek , "Richard W.M. Jones" , Andrew Baumann , Max Reitz , Denis Lunev , "Michael S. Tsirkin" , Mark Cave-Ayland , "qemu-devel@nongnu.org" , Vincenzo Maffione , Marek Vasut , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Alistair Francis , Pavel Dovgalyuk , Giuseppe Lettieri , Luigi Rizzo , David Gibson , Tony Krowiak , "Daniel P. =?utf-8?Q?Berrang=C3=A9?=" , Xiao Guangrong , Pierre Morel , Wen Congyang , Jean-Christophe Dubois , Paolo Bonzini , Stefan Berger Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" VmxhZGltaXIgU2VtZW50c292LU9naWV2c2tpeSA8dnNlbWVudHNvdkB2aXJ0dW96em8uY29tPiB3 cml0ZXM6Cgo+IDA1LjEyLjIwMTkgMTc6NTgsIFZsYWRpbWlyIFNlbWVudHNvdi1PZ2lldnNraXkg d3JvdGU6Cj4+IDA1LjEyLjIwMTkgMTU6MzYsIE1hcmt1cyBBcm1icnVzdGVyIHdyb3RlOgo+Pj4g VmxhZGltaXIgU2VtZW50c292LU9naWV2c2tpeSA8dnNlbWVudHNvdkB2aXJ0dW96em8uY29tPiB3 cml0ZXM6Cj4+Pgo+Pj4+IDA0LjEyLjIwMTkgMTc6NTksIE1hcmt1cyBBcm1icnVzdGVyIHdyb3Rl Ogo+Pj4+PiBWbGFkaW1pciBTZW1lbnRzb3YtT2dpZXZza2l5IDx2c2VtZW50c292QHZpcnR1b3p6 by5jb20+IHdyaXRlczoKPj4+Pj4KPj4+Pj4+IEhlcmUgaXMgaW50cm9kdWNlZCBFUlJQX0FVVE9f UFJPUEFHQVRFIG1hY3JvLCB0byBiZSB1c2VkIGF0IHN0YXJ0IG9mCj4+Pj4+PiBmdW5jdGlvbnMg d2l0aCBlcnJwIE9VVCBwYXJhbWV0ZXIuCj4+Pj4+Pgo+Pj4+Pj4gSXQgaGFzIHRocmVlIGdvYWxz Ogo+Pj4+Pj4KPj4+Pj4+IDEuIEZpeCBpc3N1ZSB3aXRoIGVycm9yX2ZhdGFsICYgZXJyb3JfcHJl cGVuZC9lcnJvcl9hcHBlbmRfaGludDogdXNlcgo+Pj4+Pj4gY2FuJ3Qgc2VlIHRoaXMgYWRkaXRp b25hbCBpbmZvcm1hdGlvbiwgYmVjYXVzZSBleGl0KCkgaGFwcGVucyBpbgo+Pj4+Pj4gZXJyb3Jf c2V0ZyBlYXJsaWVyIHRoY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