From nobody Sun May 19 00:42:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1649851967; cv=none; d=zohomail.com; s=zohoarc; b=GSi9/o/jdE7glcZL2NqOUfhyvkB78MMIv0JzXDkjX62vZC65nDDSNIDhQw66OR4cMUcWV7FvWA+5B1tgA2Indjn/wi9R0ylEuoa8MeZBw45qsmxQ1yytW/6oCgewA3+SnPue+tfpbI+B+wsXhgw466ei0q3H/QT5rBc4G6nWkTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649851967; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=sBtq6aJsF5JQPiNLvSzhAK+KB6fcDDkK9xa86DslMw4=; b=V5Hq4Fksv50XGdmrnvq13ttn8Er2SzBNjOW1nO+blDQRiUkzX57bf6mjaXmuExbbFTc+K20O2bqIw8SI+cIXv9ah4BJv7A2mbOrm9pG+9qC52Msb309BNBwkQvRangF75wRlZ7zAPVqE6Fwq06j5uUaXPipAbh4WtxVh2iK6EKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1649851967648757.7767307028886; Wed, 13 Apr 2022 05:12:47 -0700 (PDT) Received: from localhost ([::1]:46154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nebrZ-0006jD-Ex for importer@patchew.org; Wed, 13 Apr 2022 08:12:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nebqJ-00063I-Ue for qemu-devel@nongnu.org; Wed, 13 Apr 2022 08:11:27 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:44847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nebqI-0000rx-9r for qemu-devel@nongnu.org; Wed, 13 Apr 2022 08:11:27 -0400 Received: by mail-ej1-x632.google.com with SMTP id u15so3468363ejf.11 for ; Wed, 13 Apr 2022 05:11:25 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r18-20020a05640251d200b0041d1600ab09sm1162921edd.54.2022.04.13.05.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 05:11:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C22021FFB7; Wed, 13 Apr 2022 13:11:21 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sBtq6aJsF5JQPiNLvSzhAK+KB6fcDDkK9xa86DslMw4=; b=ZRj5BoAnztDBOXmja4R3GPmLMKCTt3ADAC1YAsQ0P04J1kGq1X0C8q0An4eJTUgHdv H1wm89rcrn4epaTGbjSB7/t03fQX7KATgliLU1nWB2qT4r5OrNVq2dxIE15SwRXEXf3i c26TdrDtc2UdFtBijsrU0ZDWzyRPW/1ppb5EcS3+WqIqIZ4jxm3su+cdQQQ1wLv/Wlhf sYycBVYBHcd/V0zyt2tAjtZJ6N0+pEmHU1uDWDdgDc2cYHMFAdhyIW2umHiWuPn1mXpc w3ZDLGtDJFBy7lATf0JSDVvfPPYAv+tF/YR/9fzrD6XQqqcz2mCjIpceSf0DNcKFnNJu RipQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sBtq6aJsF5JQPiNLvSzhAK+KB6fcDDkK9xa86DslMw4=; b=eVo9mJxDeXP5XpoxT6vaRms/t0R7ZmqISKzkVETkBtX0Wbv1MAavP/PdqEKQ6cxXVJ saEK4q71IYqcZPimYHYuWNGSW7aXsG04CSRUdcO8jyF8oDDj1xW5T7uOrsuPOfI3/0Td xLstVUdLbF/rJLYoBFBvi9lyM7oBqgoGbxMZqtHd4TpjxiQDfLblHbhe8F+vuudNV6eO K4nWe3CtbL6Zaxzz3xsHeEADHjVGqoHOFlswN0qaTnuigXRU0E89zIbFC7621SYuhX4s 1WYz0tsKXOjkrPXXjnHAiWBO3SfiGeYaXoq92p2htjOJGBunSJokndjnzYgH9tk3SI51 yWjA== X-Gm-Message-State: AOAM533Ngt/w1wCQ/SxhA2CV6JbZKwrpk4/jdrjvFg/aKuWj/LiIJvDl kz2mlORQLwwVsxm/FentawwE3w== X-Google-Smtp-Source: ABdhPJxFoi4O9NxRUrrVKpfUcBRLSIYe+dVsnqllr4zPDEHJwpKwp+KfW95vsKW+g1z02dQbjuvPQA== X-Received: by 2002:a17:906:eb42:b0:6e8:9197:f0e0 with SMTP id mc2-20020a170906eb4200b006e89197f0e0mr13511485ejb.550.1649851883929; Wed, 13 Apr 2022 05:11:23 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH] tests/guest-debug: better handle gdb crashes Date: Wed, 13 Apr 2022 13:11:15 +0100 Message-Id: <20220413121115.639610-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gautam Agrawal Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1649851968579100001 There are a number of GDB's on various distros which fail fairly hard when attempting to talk to a cross-arch guest. The previous attempt to catch this was incorrect as the shell will deliver signals as 128+n. Fix the detection and while we are it improve the logging we dump into the test output. Signed-off-by: Alex Benn=C3=A9e Reported-by: Gautam Agrawal --- tests/guest-debug/run-test.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py index 2e58795a10..d865e46ecd 100755 --- a/tests/guest-debug/run-test.py +++ b/tests/guest-debug/run-test.py @@ -92,17 +92,18 @@ def log(output, msg): =20 result =3D subprocess.call(gdb_cmd, shell=3DTrue, stdout=3Doutput) =20 - # A negative result is the result of an internal gdb failure like - # a crash. We force a return of 0 so we don't fail the test on + # A result of greater than 128 indicates a fatal signal (likely a + # crash due to gdb internal failure). That's a problem for GDB and + # not the test so we force a return of 0 so we don't fail the test on # account of broken external tools. - if result < 0: - print("GDB crashed? SKIPPING") + if result > 128: + log(output, "GDB crashed? (%d, %d) SKIPPING" % (result, result - 1= 28)) exit(0) =20 try: inferior.wait(2) except subprocess.TimeoutExpired: - print("GDB never connected? Killed guest") + log(output, "GDB never connected? Killed guest") inferior.kill() =20 exit(result) --=20 2.30.2