Received: from eggs.gnu.org ([209.51.188.92]:32953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGoB6-00038y-BI for qemu-devel@nongnu.org; Wed, 17 Apr 2019 13:16:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGoB5-0004UU-Dr for qemu-devel@nongnu.org; Wed, 17 Apr 2019 13:16:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45026) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hGoB5-0004Ti-4t for qemu-devel@nongnu.org; Wed, 17 Apr 2019 13:16:55 -0400 From: Markus Armbruster References: <20190415142519.73060-1-vsementsov@virtuozzo.com> Date: Wed, 17 Apr 2019 19:16:52 +0200 In-Reply-To: <20190415142519.73060-1-vsementsov@virtuozzo.com> (Vladimir Sementsov-Ogievskiy's message of "Mon, 15 Apr 2019 17:25:19 +0300") Message-ID: <877ebswnzv.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2] util/error: do not free error on error_abort List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy Cc: qemu-devel@nongnu.org Vladimir Sementsov-Ogievskiy writes: > It would be nice to have Error object not freed away when debugging a > coredump. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > > v2: don't change error output format > > util/error.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/util/error.c b/util/error.c > index 934a78e1b1..22f8a7924f 100644 > --- a/util/error.c > +++ b/util/error.c > @@ -34,7 +34,10 @@ static void error_handle_fatal(Error **errp, Error *err) > if (errp == &error_abort) { > fprintf(stderr, "Unexpected error in %s() at %s:%d:\n", > err->func, err->src, err->line); > - error_report_err(err); > + error_report("%s", error_get_pretty(err)); > + if (err->hint) { > + error_printf_unless_qmp("%s", err->hint->str); > + } > abort(); > } > if (errp == &error_fatal) { We've since found out that the hint should be printed with error_printf(), see "[PATCH] error: Fix error_report_err(), warn_report_err() hint printing". With that: Reviewed-by: Markus Armbruster Queued with this change. Thanks!