From patchwork Wed Apr 20 18:08:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 564008 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp4421602map; Wed, 20 Apr 2022 11:40:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeim6H4g7Hl3rhtraPpwxz5XpkgULbJqfvX5ZQynJODgZn9BiXytsrGVbGhbTndK8SyJJs X-Received: by 2002:a81:a605:0:b0:2ec:3fc3:2e63 with SMTP id i5-20020a81a605000000b002ec3fc32e63mr22187637ywa.67.1650480038996; Wed, 20 Apr 2022 11:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650480038; cv=none; d=google.com; s=arc-20160816; b=zxa423KxBdgB7Picr+D5tLN/rXGCoCwMqRAGDHY4tfkRBDBGuaDZYS9MXI0dwpGD87 5c3HpqhkCUZOtn1W7fHZ+RRXlocHWAYeAwx5XuEVZ+HzU1Gi7gmKx2kwUtL76GFJpd53 cczhFli7VieFgxbUaII+N29ILkBSbI+zlNg/Us6sc+kX1Hft9xc/xNgCbwav6I/2rywY C3RKCU7bwfW88d9uxu6hfsxB/CGBzQNAPir+xcY9lKLwziYHrKjjqpzayKq0cx1+1PBW MbzMXKv/X/0Wfnu+rYl1oC7Rzl9piyWUqdrmH7OEG2R2wuHvhfymHRMyNOMfFmYA/u6D 1SGw== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cgvFuRemyWeCyVz1dHvlNb6OyUDUe3PZXp55yAf80Y0=; b=bJIjvwP5L+hnXiCiYPjUdDsvyEY6UyDSuj3xF8fmwwyJe7YygqpkDM6RGNJ5mNiEsp xhjus9uOrs/rmiPuW7VmuNYL1QrS31MmiM4TaDQthwCicKY/FmdkMe5fal1VMqe22y51 E1OczJwBIEybOTFFoAwozzcaAwisBIhQFwWN2nCW0qZa9ieYKwIfpsNoGNb0+cCr7e7t vOQm2TwYBut+0QadD91DOIqPIkVk5d9/bExVLChBFCtHWzKfugsk6kiqplbu5ev9s7yW AwYXszy41Ik7r5u66hQ4lCzUaUeJ4MsuxfkAuQeqnrLibuq0jwunfe24YeEzNzsdL8By he7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="vdU/N3nh"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u142-20020a818494000000b002f4c0d3e3absi590116ywf.231.2022.04.20.11.40.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Apr 2022 11:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=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=@linaro.org header.s=google header.b="vdU/N3nh"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhFFm-0005G2-Gw for patch@linaro.org; Wed, 20 Apr 2022 14:40:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhEqp-0008Gx-H1 for qemu-devel@nongnu.org; Wed, 20 Apr 2022 14:14:53 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:40476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhEqm-0002KY-Os for qemu-devel@nongnu.org; Wed, 20 Apr 2022 14:14:50 -0400 Received: by mail-wr1-x436.google.com with SMTP id q3so3380206wrj.7 for ; Wed, 20 Apr 2022 11:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cgvFuRemyWeCyVz1dHvlNb6OyUDUe3PZXp55yAf80Y0=; b=vdU/N3nhWF/VAlil/sLIozhqyhPaQCU1mvk67YwM3jfr+EXUecx5qUH2F40KGd2T6k Uf2/CC8kMRh9gExuJHOGRDEYF840PAlRiTKnNxT8ROF4fbiGxEJJPgmXBOVHoeCPgmRB aQkYv9MD7Zt/TpaT1oK+owqhz9RaDlxN5QulcPXjvo+YFhoqFgx9v7fgyCwDhhdU9oWo l6YNjYATA5sohyevPdYftE8m9uFQs00M7A5SHq3nKloqrhnj+fS1ROginqMEyTW6su26 KEonSGX1uIkVijCUTl5GR+1/+o21Bat78nZFuTbuTY42ok6OvOJQEl3SfRU/XALhUyzT 4/Qw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cgvFuRemyWeCyVz1dHvlNb6OyUDUe3PZXp55yAf80Y0=; b=oBKFGR4VGSD+EqUvdG3kIKIxUG44ztzyIznxj9AkUPV/gIsdNWv2WBDGtW1L31nbSQ mACies9ACl9ScyG3gjLRtVd4oXiXcOTGpuO1m1zF/BaBQK4tmsxRpEIdEVMQ6PcaFjsd 0ivmRhE1Fk1b+9uW+/rqKwV3bS0NxBR5BZoN2lg56UFeQ6Pd5WTNS0RQpTxAW7AyrX1D YVIn0esPJvKiTUWezlJUV2F9LYmyDpyBtflbUVB+gdkIZj/JoXxyogSRkpVdErUpSI2r 5TAAlXBppOI2xMvLanHlZl8TGYlxZGs9o4qPezQCSFzJ/6KKQUihr2jBr9JRa2MmDk/w 3HLg== X-Gm-Message-State: AOAM533iXOlS9GjCbPmoieK0rsco2HSajkPhGLk0h40LChG+FZFNwnrJ 3KRiH7fKzxmHRWiq1pqkQfk8IQ== X-Received: by 2002:a5d:64c8:0:b0:20a:b841:1b05 with SMTP id f8-20020a5d64c8000000b0020ab8411b05mr262060wri.619.1650478487398; Wed, 20 Apr 2022 11:14:47 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c10-20020a056000184a00b0020a85e7f22asm580769wri.26.2022.04.20.11.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 11:14:43 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A9C591FFD0; Wed, 20 Apr 2022 19:08:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, richard.henderson@linaro.org Subject: [PULL 25/25] tests/guest-debug: better handle gdb crashes Date: Wed, 20 Apr 2022 19:08:32 +0100 Message-Id: <20220420180832.3812543-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220420180832.3812543-1-alex.bennee@linaro.org> References: <20220420180832.3812543-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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_Benn=C3=A9e?= , qemu-devel@nongnu.org, Gautam Agrawal Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée Reported-by: Gautam Agrawal Reviewed-by: Richard Henderson Message-Id: <20220419091020.3008144-26-alex.bennee@linaro.org> 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): result = subprocess.call(gdb_cmd, shell=True, stdout=output) - # 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 - 128)) exit(0) try: inferior.wait(2) except subprocess.TimeoutExpired: - print("GDB never connected? Killed guest") + log(output, "GDB never connected? Killed guest") inferior.kill() exit(result)