From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iYjVN43f0GonthEAWB0awg (envelope-from ) for ; Thu, 15 Oct 2026 10:13:33 -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=covqsKVN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D5F101E050; Thu, 15 Oct 2026 10:13:33 -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 [IPv6:2620:52:6:3111::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 AB70F1E04E for ; Thu, 15 Oct 2026 10:13:32 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D593C4BA2E33 for ; Thu, 15 Oct 2026 14:13:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D593C4BA2E33 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=covqsKVN Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by sourceware.org (Postfix) with ESMTPS id 13B3D4BA2E0F for ; Thu, 15 Oct 2026 14:13:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13B3D4BA2E0F 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 13B3D4BA2E0F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=198.175.65.18 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792073586; cv=none; b=tqmR6Ow1LQR4QFrVX3BxOpvbqQLy/HQyDS9g17w7B2PcrwOtrWziqpozMswu9M5Q9U3/NLKonrDsRLqdaYpb7ZLXNe5M+eCYVfzp6E3AK8OgYB2hFMWxUWg8eCP7Hm5hJlh9FO0bftlm6RqmVlr7evUOLXx05U/sos5z4UKMJs4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792073586; c=relaxed/simple; bh=4MnE4LACWyOlsl3zUpXyLd+khi9smTMdqyQnS1nDRwc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PyUFEGJO+1J3UV8m85iCRVrD7y135P3YeRKSdjFpUROtsrojzOqUwYrmh6KFVlcCK97NER+PAuRR4I4HUbdZ6gArNa61x82ej0xElhLKYuggm+CnAUAOLm0tnEAn1CjGZEi0jNNraTxxV60i33Cyxg2+K/YsGel+QdoolbKuu6E= 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=covqsKVN DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13B3D4BA2E0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1792073587; x=1823609587; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4MnE4LACWyOlsl3zUpXyLd+khi9smTMdqyQnS1nDRwc=; b=covqsKVN77T3bIg3fvgDjSNFzpRZKW2OKmxf8pJJiMPapHsfKjrhTqy1 VLfXRn6ZUUAFEpMZXhoSbHrsiDojWVkI8T+gcZk70GCAW9OU6xq/pUceV tFUNSfVJDexePOq8tRU4sMSOpifbJBDU3vYhPJrSdlDRozMO2mFzEO4OZ uwrflb+SFWTnBvN9VD4S26XKj+4RJfB2jSl9ZKCmsO5bM5pDNlJr1uDD8 te0hBjKekECdE910EbbmiQvXy26CvWZU7M6RA6Jy0rIe0YlSuQbiDVFXJ N3Mdoh8xVY2EluphEkDHlsG281E7mUUTZpk+2nQAB45UrJaa1+RJLBg+/ g==; X-CSE-ConnectionGUID: RVVx7nbjRoSRQBqqJdPMQQ== X-CSE-MsgGUID: oJHjn91eTr6YBF0CFd519Q== X-IronPort-AV: E=McAfee;i="6800,10657,11936"; a="844284" X-IronPort-AV: E=Sophos;i="6.27,159,1787036400"; d="scan'208";a="844284" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2026 07:12:45 -0700 X-CSE-ConnectionGUID: NAtAt8IKTkSWtQp8EwnGLA== X-CSE-MsgGUID: o5Wm+PYoSdaRJQ/mF+7ukg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,160,1787036400"; d="scan'208";a="1777480" Received: from dut1048pvc.igk.intel.com (HELO localhost) ([10.211.177.228]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2026 07:12:26 -0700 From: Stephan Rohr To: gdb-patches@sourceware.org Cc: guinevere@redhat.com Subject: [PATCH vv2 1/1] gdb: fix assert after register write failure Date: Thu, 15 Oct 2026 14:11:27 +0000 Message-ID: <20261015141127.152846-2-stephan.rohr@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261015141127.152846-1-stephan.rohr@intel.com> References: <20261015141127.152846-1-stephan.rohr@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: Eduard Sargsyan GDB tries to invalidate register cache if write to register fails. In case when write was requested to be done for a remote inferior and connection with remote is dead (so write request will fail) GDB cleans register caches and as result setting register status fails with segmentation fault, because internal pointers are not valid anymore and the unique_ptr with register status is null. This change adds check if register status cache is still valid before trying to modify (set status to UNKNOWN). --- gdb/regcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/regcache.c b/gdb/regcache.c index 773e8ac37d0..723a2759d1c 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -329,7 +329,8 @@ void reg_buffer::invalidate (int regnum) { assert_regnum (regnum); - m_register_status[regnum] = REG_UNKNOWN; + if (m_register_status != nullptr) + m_register_status[regnum] = REG_UNKNOWN; } void -- 2.43.0 ________________________________________ Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 (89) 99143-0 www.intel.de Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman Chairperson of the Supervisory Board: Sonja Pierer Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.