From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 62vuA27NAmvoSSwAWB0awg (envelope-from ) for ; Sun, 22 Nov 2026 06:09:34 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ADGvOKK3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id EDC8E1E167; Sun, 22 Nov 2026 06:09:33 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1050C1E09B for ; Sun, 22 Nov 2026 06:09:33 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C107042FA78F for ; Sun, 22 Nov 2026 11:09:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C107042FA78F Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ADGvOKK3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 379554370D30 for ; Sun, 22 Nov 2026 11:08:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 379554370D30 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 379554370D30 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795345739; cv=none; b=mXyF03hhI3nYEsoTGL0OZx7SIVtclRxPJ/58j7hdQLQC1auSNWL4IETCih6oCc2sYvkZ6Ip8IJUXI6gpAKYLWAUcYj8hDSeyoN8rGkRo2ey3UIceDOkHQUpYPwdFO959V/7NaRti749AoC7TTSvS5ncf0uiUfQRD/6UrramXyms= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795345739; c=relaxed/simple; bh=QIJF/3aU+400o3YmUKuisn0P+/5Q2vPN/Ph/+kRALK0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=NB9yPaanyzhfRViUt1ZOoRzZAbGLNqJy8WfhxZd5q6zGbdXMvUJMCZdlXKwBHSMK2+BPP+d5i6vr5Pth0cFVbdDkoaXiycm9hMCJk3YWItX1MgPRkMlokE1IeL0Inuvyi2P7/ma0pZGTShq6TH2XZ1xH8sFlOXPJLM3Kz6QONgQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ADGvOKK3 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 379554370D30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795345738; 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; bh=brP41h/QoVVFxHiAPdPCcMNw/7LcMKJm4xFvlU+VBIU=; b=ADGvOKK3YR2P5ZFSmxTIgtlP1aSEb+3McWWVvhtlN4OFpSGoKwL2EAoGsIe6vF732LyBeE HpeaEDKhcNsSiWxIQwzTY+lxeWWrAWnZUrFq3LmNoHyB97pVhA3MChfVv6BrfdXfCiuywp j7+pLtx99OFewW3sNSUrdWsTgL8j0nA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-57-tkLxRAWbPNWlBCxgcgoxwQ-1; Sun, 22 Nov 2026 11:08:56 +0000 X-MC-Unique: tkLxRAWbPNWlBCxgcgoxwQ-1 X-Mimecast-MFC-AGG-ID: tkLxRAWbPNWlBCxgcgoxwQ_1795345735 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49953abe51fso15728975e9.1 for ; Sun, 22 Nov 2026 03:08:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795345735; x=1795950535; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=brP41h/QoVVFxHiAPdPCcMNw/7LcMKJm4xFvlU+VBIU=; b=mQ02iWEEoEWq29P6ViCF3D0SxpIn5psLiV2wdMRqc57iF0kzQzJxr+us+pfGPZf9FP 3VZcR+IZoyKIvAwPeeFATdl/F/6S+11qBMMwHfc8sxb0xA4yj2AFB54puPNaAm1wVUpv AaBZs/rohp0gAdQp67kmZzfLSDXsC30TsfzHjp7vLh7hhy1yuocOlnUlJf1G9Y4O7b0X K6TmEqK2HQGHjuHb+Pxn01im4/uZ/16QBHnVj2th2llGWPZ+ISK/4ULvMGNw6Xmm23UK yM08KkHmtSliEV1ZCaN1RV+KlYEYk8qb/0Drk9CMT6dXhjbmbaeZ0hXGq3rU4i/TJgFB 3Hjw== X-Gm-Message-State: APuU4Z87aM7ddtnlIdWXaTXXShSpXQAB/jGTK0Why16INDymj+1WFfmv xH/ej3tliQBWtkNzTGHiFCnGraCeyn7zDPFkzmZXiHbJJ4AeMXyHGf+RMeG/b0PaM0d+38GNe7+ wOSuYALpuGcemXsP+A0Uj4WJteLHz/b3L078rK/iA2Oa4+zhdkfRfai426sktJHOQ8SsCmQfTpX gYN+LaQqSiprVGapTiQsJzGBzQx5kPB/qkLzd+yT3/5OJDzpw= X-Gm-Gg: AZFdTZfcH6z6crkIdNT3hLVTuENJAa5TPIgsF2N+gKCrXycVWtVDfKWfZl0SkDKQqGV PuFeKEAMpyc9i5RLEM5HooLK7NH2V2lAxhIN3UhjumnYMsfqj8X76mOZdfZDWdJmvPfV0sVVx+b ddTsk2DdTDGR7RIE4LUG669+0m3CLcdriBQE0mFkCmsu+mhaGRQddF8mkNOQSO2srBZCX360aoL JobKzWU71IrKuGC3CthqHaVonmgynEkhwRnZ101DRHTmyPnakIu7DC6fBKvoca+g8G1JXHBLX1P J1RwsiyIkvBVDS+o2DVvL4wSl8gBAQFpvT9xIZ5OUp9VgDL3cjPqYasfaEPDnFPVRf3Ce/ci56F 4Yf7kN+bsUb3WeLJuGM7veuWIv771CZoEthz/fdnEJ3uXjg== X-Received: by 2002:a05:600c:674b:b0:4bb:6947:3e1d with SMTP id 5b1f17b1804b1-4bb8892c0fcmr167535085e9.20.1795345735208; Sun, 22 Nov 2026 03:08:55 -0800 (PST) X-Received: by 2002:a05:600c:674b:b0:4bb:6947:3e1d with SMTP id 5b1f17b1804b1-4bb8892c0fcmr167534745e9.20.1795345734724; Sun, 22 Nov 2026 03:08:54 -0800 (PST) Received: from localhost ([83.216.138.189]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb88f148aasm96920215e9.0.2026.11.22.03.08.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2026 03:08:53 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PUSHED] gdb/testsuite: don't spin forever in gdb.tui/flush-after-run.exp Date: Sun, 22 Nov 2026 11:08:50 +0000 Message-ID: <7f8c8d38cc60fe15e1cc615aab7babd4a0ec7106.1795345716.git.aburgess@redhat.com> X-Mailer: git-send-email 2.56.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: tL5_rlT72KRqgge94T6j04VW352SiLqChZx4J_h5CU4_1795345735 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Recently I noticed that this test would hang forever: make check-gdb \ TESTS="gdb.tui/flush-after-run.exp" \ RUNTESTFLAGS="--target_board=native-extended-gdbserver" The test starts an inferior and waits for the inferior to create a file in the file system to indicate that it is running. However, if the inferior never creates the file then the test will spin forever waiting for the file to appear. An unrelated recent change in GDB (the gdb::span work) means that GDB is currently crashing when using remote targets. A fix for this issue is already on the mailing list: https://inbox.sourceware.org/gdb-patches/20261122054124.3738131-1-tom@tromey.com But I think it is still worth fixing the test so that if something like this happens in the future the test will not hang forever. Do this by placing a limit on the number of times the test will spin waiting for the inferior to create the file. As the spin loop includes a 'sleep 1', this limit creates a maximum time that the test can hang for before giving up. There should be no change in what is actually being tested after this commit. --- gdb/testsuite/gdb.tui/flush-after-run.exp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.tui/flush-after-run.exp b/gdb/testsuite/gdb.tui/flush-after-run.exp index db20b8cee80..df8161a4f3b 100644 --- a/gdb/testsuite/gdb.tui/flush-after-run.exp +++ b/gdb/testsuite/gdb.tui/flush-after-run.exp @@ -41,11 +41,20 @@ file delete $marker_file # Run the inferior, which will create MARKER_FILE. send_gdb "run \"$marker_file\"\n" -# Spin until MARKER_FILE appears. -while { ! [file exists $marker_file] } { +# Spin until MARKER_FILE appears. Wait up to ::TIMEOUT seconds. If the +# inferior fails to start (gdbserver crash, inferior startup issues) then we +# don't want this test to spin forever. +for { set i 0 } { ![file exists $marker_file] && $i < $::timeout } { incr i } { sleep 1 } +# In case the loop above bailed out due to timeout, spot that the marker file +# hasn't appeared yet and abandon this test. +if { ![file exists $marker_file] } { + unresolved "marker file failed to appear" + return +} + # We now know that the inferior has started, and that the 'Starting # program: ' string should have been printed to the terminal. Don't # use Term::wait_for here as there will be no prompt after the base-commit: ab4dbb9838795fe09a82d41d86b47de29fbf80f3 -- 2.56.1