From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id dtgTK5ejFGSTahIAWB0awg (envelope-from ) for ; Fri, 17 Mar 2023 13:29:59 -0400 Received: by simark.ca (Postfix, from userid 112) id A4C5E1E223; Fri, 17 Mar 2023 13:29:59 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=cfYeXytn; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5048E1E0D3 for ; Fri, 17 Mar 2023 13:29:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB0AA3850854 for ; Fri, 17 Mar 2023 17:29:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB0AA3850854 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679074198; bh=8UymT/Nm7bpGWhHcjEK5t4S2Xcus4bsHtFW8dQ+s9Ek=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=cfYeXytn9SWytG1OEGmnFgWutmOBWzwIxV3+zzZ5CzHTIMNMCBgjW8XuTvWtrWntL OHy8Vm41SCTdWB6gCmdDjii0gji54G7jgztZGhOwVVAwIkDk0aCVLRo0CBVXKEptiE 0vb4tIjNhvpRnmvR2gZeORzss/dn9DKPFTC8wJdc= 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 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) 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > 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