From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Gc0yH1UAVmoHiQcAWB0awg (envelope-from ) for ; Tue, 14 Jul 2026 05:24:37 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=GkbvEzpP; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7952C1E09E; Tue, 14 Jul 2026 05:24:37 -0400 (EDT) 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 8B0341E099 for ; Tue, 14 Jul 2026 05:24:36 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EFF8F4BA5439 for ; Tue, 14 Jul 2026 09:24:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFF8F4BA5439 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=GkbvEzpP Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by sourceware.org (Postfix) with ESMTPS id 58FE64BA23CA for ; Tue, 14 Jul 2026 09:22:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58FE64BA23CA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 58FE64BA23CA Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784020948; cv=none; b=HpS3nUnt8x+AyRisbAddLPBR3CbUPqb9J8r3eYteRgQ9Yuw8JX6suM/9uxj7caqHjoW3pluwWTQqoRK/lbxb+mmzTqV9Qs2ampW1rCHbmrrhuKvuJSGsuNgTgW7TU36+3CCDYqyRDfKhRVYVS9glkq29ac7XOdgOLvsuuu7Zf8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784020948; c=relaxed/simple; bh=n9py4C8R8kdZNptXXd0hVuFTnB8id7tGjl0n/+5zIfA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pMHuwnn9uIQ+u7RiC95qlQGJ+I9o15R5V8knCRfWEMXbL6bb1HazzVSMN2RxxiHjUqgIndgxAXmrzzt0gQbZDZBjwjpsscjlk51OtYf515L451L+EPPhCBJWJ+Egjo8zCrx4POZ6rsynfZPmqOTFhkB0T9v5Obz2FNiQObYRp0I= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=GkbvEzpP DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58FE64BA23CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1784020948; x=1815556948; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n9py4C8R8kdZNptXXd0hVuFTnB8id7tGjl0n/+5zIfA=; b=GkbvEzpPLNyJ0kMfp/Ydswo5BxFzxUG3mP4Myo6r/yZTonjLVaEpNtdm U7ksJAkuTrYRWW6h0Mj+YR4vZyjE73zPXe1yqY/xTqW3JBm6j4k7AqH0F DtdxPIxmebppmekr6Qf0yyo9zxiL+p9VjK7iZZtXukUCifiq3rrbP/Tk8 iSRicUy0aq4kMEtNaGtdE0PCPpYDMk9DFikKZY7Dpg7cIaU0yGeqxgR9y aTrPT8iha3Nr5YV6qfIaco0jeRfm6uSw+SOtYXyUJPOSNj5WTTawcQnot 5PKGxea23mY8kxaDcxbwGgA5ZWnGNsZkcSqhiHQCf5D2t2KC5c1LXayUV g==; X-CSE-ConnectionGUID: 1delWvSAT22Wp7QbMBEuwA== X-CSE-MsgGUID: xTyn0JDkR1m9084pUDFxOg== X-IronPort-AV: E=McAfee;i="6800,10657,11846"; a="95239891" X-IronPort-AV: E=Sophos;i="6.25,163,1779174000"; d="scan'208";a="95239891" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2026 02:22:27 -0700 X-CSE-ConnectionGUID: McsdecSgSaSw6bi+UzO1kQ== X-CSE-MsgGUID: BmtGvIgsSAmH8LHxA1rsXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,163,1779174000"; d="scan'208";a="252423074" Received: from sguenant-mobl2.ger.corp.intel.com (HELO localhost) ([10.246.18.94]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2026 02:22:24 -0700 From: Mohamed Bouhaouel To: gdb-patches@sourceware.org Cc: markus.t.metzger@intel.com, stephan.rohr@intel.com, eliz@gnu.org, aburgess@redhat.com, pedro@palves.net Subject: [PATCH v4 08/11] gdb, testsuite: handle async close in monitor-exit-quit.exp Date: Tue, 14 Jul 2026 11:21:25 +0200 Message-ID: <20260714092128.12941-9-mohamed.bouhaouel@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260714092128.12941-1-mohamed.bouhaouel@intel.com> References: <20260714092128.12941-1-mohamed.bouhaouel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 From: "Bouhaouel, Mohamed" With non-stop remote targets, the "Remote connection closed" notification arrives asynchronously after "monitor exit" and may appear while processing the quit command, causing test failures. Fix by handling the async notification in both the monitor exit command (for early delivery) and the quit sequence (for late delivery). Reproducible when running gdb.server/monitor-exit-quit.exp, on native-gdbserver or native-extended-gdbserver with target-non-stop enabled. export GDBFLAGS="-iex \"maint set target-non-stop on\"" make check TESTS="gdb.server/monitor-exit-quit.exp" \ RUNTESTFLAGS="--target_board=native-gdbserver GDBFLAGS='$GDBFLAGS'" --- .../gdb.server/monitor-exit-quit.exp | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.server/monitor-exit-quit.exp b/gdb/testsuite/gdb.server/monitor-exit-quit.exp index cb90169ef0c..46c11fe9462 100644 --- a/gdb/testsuite/gdb.server/monitor-exit-quit.exp +++ b/gdb/testsuite/gdb.server/monitor-exit-quit.exp @@ -49,12 +49,27 @@ set gdbserver_protocol [lindex $res 0] set gdbserver_gdbport [lindex $res 1] gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport -gdb_test_no_output "monitor exit" -gdb_test_no_output "set confirm off" +# With non-stop remote targets, the "Remote connection closed" notification is +# delivered asynchronously and may appear while processing the monitor exit +# command or shortly after (captured in the quit command later). Handle the +# early case here. +set r_conn_closed "Remote connection closed" +gdb_test_multiple "monitor exit" "monitor exit" { + -re -wrap "$r_conn_closed" { + pass "$gdb_test_name" + } + -re -wrap "" { + pass "$gdb_test_name" + } +} set do_cleanup 1 -gdb_test_multiple "quit" "" { +gdb_test_multiple "with confirm off -- quit" "" { + -re -wrap "$r_conn_closed" { + # Async "Remote connection closed" from monitor exit, delivered late. + exp_continue + } -re -wrap "" { fail "$gdb_test_name (prompt)" # Let default_gdb_exit do the cleanup. -- 2.43.0 Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 89 991 430, www.intel.de Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht Muenchen HRB 186928