From patchwork Sun Dec 11 17:59:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 13070633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EAD1EC4332F for ; Sun, 11 Dec 2022 18:00:35 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.458963.716650 (Exim 4.92) (envelope-from ) id 1p4QcU-0006IJ-PI; Sun, 11 Dec 2022 18:00:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 458963.716650; Sun, 11 Dec 2022 18:00:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p4QcU-0006IC-MT; Sun, 11 Dec 2022 18:00:10 +0000 Received: by outflank-mailman (input) for mailman id 458963; Sun, 11 Dec 2022 18:00:09 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p4QcS-0006I3-OM for xen-devel@lists.xenproject.org; Sun, 11 Dec 2022 18:00:09 +0000 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a50482a0-797d-11ed-8fd2-01056ac49cbb; Sun, 11 Dec 2022 19:00:07 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2D6215C00B1; Sun, 11 Dec 2022 13:00:06 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 11 Dec 2022 13:00:06 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 11 Dec 2022 13:00:04 -0500 (EST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a50482a0-797d-11ed-8fd2-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t= 1670781606; x=1670868006; bh=9/o//YpAd6bPNnp2ez44OcRIJkNkCRCgVpa pd+ho7Ao=; b=aB5HB6mUPJs2uf7aEqlH7AYmwLVBW/G8rBmRAhqsKIQAH38SEHM K0KC2ztPs2RxcWL3E4V0F6bJ/mJ6xIysLOJaIVnpvQ2HOqvCeM6Jlzo0ZWEYhddr KevfSWtTHya9NLy/Z7icTbODRS5ycft7xPEFJTHeZkVJAADGcY/Qxudgc/8z4b7F 7rEjB/3Rypt8BNCwMJv2XJqYOVju1QxegkMHxzAezrzVG/W7A8N6cesbdvMNmaok rw1FzYsQNrPY5wRj2MFGTN5iUE0n32Ec5vObwWUCzLCXh7MZiHshbmhzdbbtTzHT T1oXFWtx3tEQ/MMk8jPcZLiPqd7Rljq6eHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1670781606; x=1670868006; bh=9/o//YpAd6bPN np2ez44OcRIJkNkCRCgVpapd+ho7Ao=; b=v/VJCdlO+J+u3+32D3XYQyf+sye62 BSbsfDAelrSiTMK0Per6d9uwgIFwwGSUNfDzweOOeDhRjSAAgeANl+Kc5N2AwdYX gxzNE/6m3t954wwCX4N1lY2WEL8uEq90945CrcAHmFb0u9noDxMfziELc7zY9JKV /8q/EXDZytV6bewAJjdolMngFQNdX6k8Mf72GoOR/Jb4mqF5KpH1Q1z/j6SNl96G QbWrY3LNtagzhZi62fVjVmzK7YUAhaUNQL5arycUux4rszH91UcrftnYlchlbkt8 NpVkHnm8/s8BWJefGL53MmfKFWGsiAg+AwIFDvL8Zt2xBpqA18mBg41Qg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeigddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeelkefh udelteelleelteetveeffeetffekteetjeehlefggeekleeghefhtdehvdenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Wei Liu , Anthony PERARD , Juergen Gross Subject: [PATCH] libxl: abort on memory allocation errors Date: Sun, 11 Dec 2022 18:59:49 +0100 Message-Id: <20221211175949.2193629-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Use abort() instead of just _exit() in libxl__alloc_failed(). This is more friendly for debugging, as it will trap into debugger, systemd-coredump will collect coredump/backtrace etc. It's much more useful than just "libxl: FATAL ERROR: memory allocation failure (...)" message without context where it actually failed. Signed-off-by: Marek Marczykowski-Górecki Acked-by: Anthony PERARD --- tools/libs/light/libxl_internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_internal.c b/tools/libs/light/libxl_internal.c index 86556b6113b0..c95624933ffc 100644 --- a/tools/libs/light/libxl_internal.c +++ b/tools/libs/light/libxl_internal.c @@ -36,7 +36,7 @@ void libxl__alloc_failed(libxl_ctx *ctx, const char *func, } fflush(stderr); - _exit(-1); + abort(); #undef M_NSIZE #undef M_SIZE #undef M