From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8WUBMFKcS2pKvCkAWB0awg (envelope-from ) for ; Mon, 06 Jul 2026 08:15:14 -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=IH8qCT8c; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C036C1E098; Mon, 06 Jul 2026 08:15:14 -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 4E6E21E070 for ; Mon, 06 Jul 2026 08:15:14 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA3FD4BA2E21 for ; Mon, 6 Jul 2026 12:15:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA3FD4BA2E21 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=IH8qCT8c Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by sourceware.org (Postfix) with ESMTPS id 7C0154BA2E0E for ; Mon, 6 Jul 2026 12:13:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C0154BA2E0E 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 7C0154BA2E0E Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783340013; cv=none; b=Yiz2tamtdiBA6OUI6yimMwvN+k4ar06xlyluX4gixp9hboq0uMG4PapFwNIG0cLaL1r5XDD6XLOGefU89gzpCEAUHARz7xvx968CFDTRAcdLU+HmhQyAocaNX2TOv0J45HAkd/wh7VJBAXfws0tLYMQVsE8NjvV5xm22TpXaOks= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783340013; c=relaxed/simple; bh=n9py4C8R8kdZNptXXd0hVuFTnB8id7tGjl0n/+5zIfA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vS0E5ackO8/aoYoajqLo1u5eUvU6/EjbHOVlbCD6Ea6IaT7Osymk8Ea+kCCuDmML6kbqDN80gg+ooVw8nQbDFzjQfNzMjLyGjAAm3IYhLNrPiS6OawlV5NWw/EtAyJHRdayAulIvh1IUHFBM4TKbZtb5QZKNX0/XafqT8Xs5NrQ= 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=IH8qCT8c DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C0154BA2E0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1783340013; x=1814876013; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n9py4C8R8kdZNptXXd0hVuFTnB8id7tGjl0n/+5zIfA=; b=IH8qCT8ctnoygV0CuqEiRN/QouZjojvwPmEFi8PUvBeKL0GQ2T3ayn/4 D/f2LVN+p3VXrdWvDezNqMFy1/I7Xuj3D0bcx0QytvscvtN3ei8GQPR0k dloz3V62xoxO1Zy0DETeVmJ4qI9pEG8EEYcXe8CWLQwBtbhuuB8JtL0Q3 I4VvkKs5/73ryUglLM6J88dXLQsDYeuUcJNDh8e4SyMfJGewaNRPP/2X7 Qn9bnJMEuWq+jsukWCLudpp5vEdD3EYb/K8vRoQuScb7H/OkQ6kem43r5 oR6/ogWe0ZTtItXF8OrU4yDKrAAPfmBfzwfaYsSgEN94ekSGClbZhHeVh g==; X-CSE-ConnectionGUID: k2kvWkp8RUy8hEs2/m65Sg== X-CSE-MsgGUID: dyjKeuMOSgS77GxPSE0oQw== X-IronPort-AV: E=McAfee;i="6800,10657,11838"; a="101516753" X-IronPort-AV: E=Sophos;i="6.25,149,1779174000"; d="scan'208";a="101516753" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2026 05:13:33 -0700 X-CSE-ConnectionGUID: bnNmgX7xRkyNBRm9lGucCw== X-CSE-MsgGUID: mC8/vNMwSVCB532rMCGRBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,149,1779174000"; d="scan'208";a="251015958" Received: from unknown (HELO localhost) ([10.245.114.180]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2026 05:13:31 -0700 From: Mohamed Bouhaouel To: gdb-patches@sourceware.org Cc: stephan.rohr@intel.com, markus.t.metzger@intel.com, pedro@palves.net, aburgess@redhat.com Subject: [PATCH v3 08/11] gdb, testsuite: handle async close in monitor-exit-quit.exp Date: Mon, 6 Jul 2026 14:11:21 +0200 Message-ID: <20260706121124.18784-9-mohamed.bouhaouel@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260706121124.18784-1-mohamed.bouhaouel@intel.com> References: <20260706121124.18784-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