From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2RkyMcNbC2q97QUAWB0awg (envelope-from ) for ; Mon, 18 May 2026 14:34:43 -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=kc9yM1I1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C53811E024; Mon, 18 May 2026 14:34:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED 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 55C091E024 for ; Mon, 18 May 2026 14:34:43 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C8E304BB24EA for ; Mon, 18 May 2026 18:34:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8E304BB24EA 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=kc9yM1I1 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by sourceware.org (Postfix) with ESMTPS id 322504BABF3D for ; Mon, 18 May 2026 18:34:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 322504BABF3D 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 322504BABF3D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779129254; cv=none; b=mzgZfOHCgdzb2JHbQTO0ND88T1hGEQd8gbvvGXPSL9Jfkmugm50K9ZIk+kQLbQ7s3tTnuhDi8UGQgNUIs+KKjgrBLhx2n2FvVYAoW3soQilA9Jmz7C2q8eLP+2depKYJPqGj5Ppb2fbergoIvsLgxmEJTRBDbhm3vqorpHk7AO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779129254; c=relaxed/simple; bh=wplRZ1nCFMHTxhWHEq7kCd69ZdKrfxgojBSus9ONedY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=VbJwXbX4E00Und1ksDurLwoa7W4lNSbfjEJpy652n8ECWqlMKNOsbgw0Wuo1tGPSpu47JBjtCXD1gE/nKOptOgWY2xVOq/o8U4/zaETmb0m6T5hyhpZyOtvdic+ehSANDRDf2Wk+zr2FKSeRnfcfcX8o9XIT37NOVD5b7i2iF6Y= 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=kc9yM1I1 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 322504BABF3D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1779129254; x=1810665254; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wplRZ1nCFMHTxhWHEq7kCd69ZdKrfxgojBSus9ONedY=; b=kc9yM1I1zVqN78MfzHk+xF6+guGs63gQklo35/HGnmeKihbaRPOlXFLG WZQZSqMYENlCjOnZb9XLyxWOlToVSRiMe07dtsK2oiSXC7Qu5qAZzBpZ/ IE04jwh2r5C1kqm68Fn1hhmjjDO+ClLhK+DFdQ0U2aeEkvcnZQInyNnws W4bszis3sDKj6UoJm0usKWfmvC82Dkvo4bCi7DzbigCFkU8bzEp9x4/+q c3pl+b2U44d/DG9Wz6UyzUoPMMp47rPWHD/xopU69nA7pT/F+PsJLj4Jy BhoE5XHjubxWX9d90TaAUnZ8ocdZ3ciAkoOcxvLuJv0v2aAU06C9hATkE g==; X-CSE-ConnectionGUID: OSj5dTT/R6Wwq9c/7n0bJw== X-CSE-MsgGUID: sO3UqstmRtG986L949LoSQ== X-IronPort-AV: E=McAfee;i="6800,10657,11790"; a="83849804" X-IronPort-AV: E=Sophos;i="6.23,242,1770624000"; d="scan'208";a="83849804" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2026 11:34:13 -0700 X-CSE-ConnectionGUID: ahT+EBtXR/CvUtB98by7Lg== X-CSE-MsgGUID: PL1rfjKfQNur37C3bbHkdw== X-ExtLoop1: 1 Received: from cwhite-mobl.ger.corp.intel.com (HELO localhost) ([10.245.114.180]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2026 11:34:12 -0700 From: Mohamed Bouhaouel To: gdb-patches@sourceware.org Cc: mohamed.bouhaouel@intel.com, stephan.rohr@intel.com, markus.t.metzger@intel.com Subject: [PATCH 03/11] gdb, remote: fix async handler assertion on reconnect to non-stop target Date: Mon, 18 May 2026 20:32:59 +0200 Message-ID: <20260518183316.127043-4-mohamed.bouhaouel@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260518183316.127043-1-mohamed.bouhaouel@intel.com> References: <20260518183316.127043-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" When reconnecting to a non-stop remote target during process_initial_stop_replies (), the code attempts to mark an async event handler before async mode is enabled. This causes an assertion failure in remote_state::mark_async_event_handler (), which requires the serial connection to be in async mode (is_async_p () == true). Fix by changing the condition in queued_stop_reply () from target_can_async_p () to target_is_async_p (), matching the pattern used in push_stop_reply (). When async mode is later enabled, the event handler will be marked then. Scenario: - Connect to non-stop remote target. - Thread receives signal (e.g., SIGUSR1) and stops. - Disconnect and reconnect. - Assertion fails because mark_async_event_handler () requires is_async_p (). --- gdb/remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/remote.c b/gdb/remote.c index 4bdbf4aeb08..b7ccd72829b 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -8385,7 +8385,7 @@ remote_target::queued_stop_reply (ptid_t ptid) remote_state *rs = get_remote_state (); stop_reply_up r = remote_notif_remove_queued_reply (ptid); - if (!rs->stop_reply_queue.empty () && target_can_async_p ()) + if (!rs->stop_reply_queue.empty () && target_is_async_p ()) { /* There's still at least an event left. */ rs->mark_async_event_handler (); -- 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