From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id ECE81385559F for ; Fri, 17 Mar 2023 17:29:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECE81385559F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 1283B1E0D3; Fri, 17 Mar 2023 13:29:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1679074178; bh=OtjzjBjyLbEP3C7930xKaejMeJjJPswEJ++Cpv+hHTQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ARkgPfghptQdJ1plp2u5wYNi7bxFHGIwVTl6dOhdc+3q3XDuDNTUQUvpHfADMHXsv PZv/3F7Kk9r5yrz5qWDPd2CxIK8/S4yX3MzwD0qE/O8hgnfkpxGhrn7shU6ZVRpS3n zMz3zG8QoJTtylecYwgkZMXarTV7OfYt/xjcokr8= Message-ID: Date: Fri, 17 Mar 2023 13:29:37 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] aarch64: Check for valid inferior thread/regcache before reading pauth registers Content-Language: en-US To: Luis Machado , Andrew Burgess , gdb-patches@sourceware.org, pedro@palves.net Cc: marcan@marcan.st References: <20230316103904.1947447-1-luis.machado@arm.com> <873564g0h3.fsf@redhat.com> <5ce96222-d665-5129-8d65-27c6933a6623@arm.com> <6aa8edc2-81f7-b08a-805f-9a20185995d2@simark.ca> From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > What would be the outcome of this call when there is no active register cache because the inferior > has been killed? I think it would assert in find_inferior_pid with a null_ptid. > > aarch64_remove_non_address_bits gets called for any memory access, so we may be in a state where we have > a valid stopped thread, a valid running thread, core file, no inferiors (just reading symbols/bfd) and so > on. > > Or were you considering doing a check for inferior_ptid == null_ptid before calling get_thread_regcache? Yes, a check for inferior_ptid == null_ptid would make sense. I was really just thinking about the initial problem, which is aarch64_remove_non_address_bits being called while processing the event in thread-db. Simon