From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iHAVLrWlFGS1axIAWB0awg (envelope-from ) for ; Fri, 17 Mar 2023 13:39:01 -0400 Received: by simark.ca (Postfix, from userid 112) id B84E41E223; Fri, 17 Mar 2023 13:39:01 -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=PMTbI2sl; 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,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable 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 6F48F1E0D3 for ; Fri, 17 Mar 2023 13:39:01 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ECDA738515FB for ; Fri, 17 Mar 2023 17:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECDA738515FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679074741; bh=yeTl6ANsAGyGDKxIIvGifJxMhfgl7VEjBI/mCAD/U28=; 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=PMTbI2sliUh4AXeo+eZZDTDxJMdq/lAOeXnLR3zwoJJ+DkoTAe2SzwlLN6gdcqytl 82eOXfHF1t7LW3r1psFcBwraavSyS19k+uC19hXdme5u50jXHsB5l8opLlcDGib6dH WDm+wURLZrN/5qSFiZCimEOfgKEHIrMP9zs7xO48= Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2073.outbound.protection.outlook.com [40.107.15.73]) by sourceware.org (Postfix) with ESMTPS id 3767E385559F for ; Fri, 17 Mar 2023 17:38:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3767E385559F Received: from AM6P191CA0067.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::44) by AM8PR08MB6337.eurprd08.prod.outlook.com (2603:10a6:20b:355::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.35; Fri, 17 Mar 2023 17:38:35 +0000 Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::8b) by AM6P191CA0067.outlook.office365.com (2603:10a6:209:7f::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.35 via Frontend Transport; Fri, 17 Mar 2023 17:38:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT059.mail.protection.outlook.com (100.127.140.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6199.18 via Frontend Transport; Fri, 17 Mar 2023 17:38:35 +0000 Received: ("Tessian outbound 55ffa3012b8f:v135"); Fri, 17 Mar 2023 17:38:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fdaeb95510205087 X-CR-MTA-TID: 64aa7808 Received: from 8396ce6ff741.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7BEAAE51-36DE-4BE5-9AF2-39DC29AB5502.1; Fri, 17 Mar 2023 17:38:28 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8396ce6ff741.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 17 Mar 2023 17:38:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NYfSjAOT8UgnLv/9ZXVeZaIHmVStnQCegDS+jb5zMF5/4sZ9qDI7Fb2Nbug7w8kJtStk+OJEr1XdRHesJ+uvN24FQnIcLKV/7G5ciyA1Klr8g2R5AT5VPHkduRpgfjHkMtLW9szRmynzI6+c3+QEMbmJo0IPMKtZEgrORcHkZEY5ohYuHLO2TgH/U7VFLaxonloNwEpjIt6cAKrOl+CIwKX4Zq732k0ufLfT09UOuuoKUlHkRWe+JaePJwQ7GEds5Oot7KhDE7oePOUOgODJhh4lsXZg3SCR/Rl17OaZGfGBg6XpCCyHmUEPRdk9DHrVhS8drWVxWhRj3eZwXL7glg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yeTl6ANsAGyGDKxIIvGifJxMhfgl7VEjBI/mCAD/U28=; b=GZovOxrgg9cY9sJPOoVwPuwYVMXXKlOJLDmbRIY4HdPuY1cjSz9LEuTDoYJEtBssssCc0pIQFNunOUrfAa9Dh/+GPON7aoh6QuDXzm1nSieNJZJOqgciSV7N/VyJUcKQ3wOocZoD6PhC6gjFJg8t3dlUc3UxScz2nPmcx1oDxObBqJELkkAHAH/qZoEh9ZDegcUZz02XVCqNnV9lzplK73mBk4ISeeaxC1WBoRuFj/NFZfp2ir+i+1xbilH3b9BZQpdv0f7VRrnQQrYW/oN2FpivPaRHmCWSPw1EhZDtlNBRVNqAGxe5UKHuazE08DA+jmjcJZUKp2Ou5bHnhEPbWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by AS8PR08MB10150.eurprd08.prod.outlook.com (2603:10a6:20b:62a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.31; Fri, 17 Mar 2023 17:38:26 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6%5]) with mapi id 15.20.6178.035; Fri, 17 Mar 2023 17:38:26 +0000 Message-ID: Date: Fri, 17 Mar 2023 17:38:14 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] aarch64: Check for valid inferior thread/regcache before reading pauth registers Content-Language: en-US To: Simon Marchi , 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; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN7PR04CA0079.namprd04.prod.outlook.com (2603:10b6:806:121::24) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB10150:EE_|AM7EUR03FT059:EE_|AM8PR08MB6337:EE_ X-MS-Office365-Filtering-Correlation-Id: bf72b837-6a17-42e4-4bef-08db270e6f75 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: md/VbC73ld8maEmSIzpITH7AMzqZoNT6YQLsRm5/lk53Qzxi2G0UEIgJGlz9kncmtvJg5s6VPbNhLAhHmsF0S82j5Gmz0nkaVQ+cY0kwaLrIDS5nu960UPOZ/3o24IFi6rvYBlD+B/Se6s806vt3YZuS4jhI9PY4O8oShCZPkzG74e0MvDD17GOybsQdDjlYsVgQjBm98iTEv/JwPHqLkX3H6TSBAHCaHv9/mbDj/lrIsNpyzky1e5x0ZnaIwVd5y9gOPVZHUIC+QdSxkzRa0sYmFxTKt3RmsAjTGCPBGMT5zkvCNTMqs3vyOzR8zXkMo2WjYGCbgH2IhaRxspzVbWB3Br8HZAAeQE7gaRuko7ed09CgY/5vKmzEbixWRK7mzLYT4cK7lE3QLKLQiJwJW6JzLmhHRCQ0CSu+r6lrPyy1WC7I+xDbhzlR0kHUwphQzv+hDsFb6UzUmpysfzG5R1QBVpYLFMTYXDtyS8yDWrmLxKfO1736hIC8BGylH4hzk7nmLaa7HA6ModNICK5rDEPFuVzsFslxiki6jZwc43nbQwe3wACB7RUZTIj0ZMXLPVK1kX7Lw28Oktbybr8ddeP/Jepy/twbt7yOkxk2xfLX7GiBIiC0l/71rvoJmx3bFTHHCO6QWbnokvsHME/k9OSLGb3K+APp2krjktVy55XavsmVtsQu7+Cv+Qd7n+QUdmRoTfgPjG1XLBK28dTVG/TxDcYeBTmOkJnJDk2CpGI= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(451199018)(38100700002)(31696002)(86362001)(8936002)(478600001)(36756003)(44832011)(41300700001)(2906002)(5660300002)(26005)(4326008)(2616005)(6506007)(53546011)(6512007)(110136005)(83380400001)(186003)(316002)(6666004)(8676002)(66556008)(6486002)(66476007)(66946007)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10150 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5ef9e484-2eb6-41e2-9937-08db270e694b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 398UiJd4agTjlqwnfCwPyeOR2+Vy0GwWk/IvKhDAjRL7e+Kj3m7Ez4dAgzmetwX61XURnnD9FDzKJdidT1gpb+th9QsG+UzFT3WRCL/l9xiyz5LwI3M9ZD6jxl1DShr2b2KV8vJ1nrI1d5UaV2SlFK2J8jfnzVIEMHEoGRp3Z6vFuI1NqP9I8LCfiLlMNGTxbriQviy34lIhxpQjEE+NpsjwoUPKuDR35BuMtmkCyMn1We75eW9Kx6VlaET88Z4o//UpivIH7nFoZxCMuE4WcJaqo9B2c3CVXD5K2TT8R+V/meSljjpXvx5guGtO6WhS4g3F2RLriFo8V7uX916DtB9dwS51YE5W58ezn93yFwuqAtQlzxEw7Aopd7zyfv9r5M1Q1Ynxsi6ZQuRq4D8barDfyDzr5R+JMKC9r8qlrPrY5rG3X0GBSWZ+D793blFUgmJVdmDEiNk+0R7FhkA23WHJcTKIU7kyVwRpUp34rl2nfrt46DsItxMXS3bz5tNvuvKgtcUo97caVGVbl9Ufzisct9Li+1JfGSs1l3WitVI6GvQAPpIYLU2t5THgTI0BWGAmQX+U9Hx77auEiTZARCSnfmMLfOKHwmEkBrjgreCQPd0qKKfAosPPpv8wQP2gIgrKgBquznzfBn+YE6IwGgGABURSE5GXbfcECRbuG+PcPGkzzzrN5YuRZO5IdM4jIXAhHGJimxr9lLnw4foej9C0m/btV36w6Mn7TxPFEI4= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230025)(4636009)(136003)(346002)(39860400002)(376002)(396003)(451199018)(40470700004)(36840700001)(46966006)(2616005)(186003)(336012)(6486002)(6666004)(83380400001)(478600001)(47076005)(107886003)(316002)(8676002)(6512007)(6506007)(26005)(31686004)(70586007)(70206006)(110136005)(53546011)(4326008)(36860700001)(41300700001)(8936002)(44832011)(5660300002)(81166007)(40460700003)(82740400003)(2906002)(356005)(36756003)(82310400005)(31696002)(40480700001)(86362001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 17:38:35.5415 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf72b837-6a17-42e4-4bef-08db270e6f75 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6337 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: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 3/17/23 17:29, Simon Marchi wrote: > >> 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. I could switch to using inferior_ptid instead of using the helper functions to check current_thread_ if it is deemed more appropriate. If the threads are running while we try to read memory, the try/catch block will guard against register read errors. > > Simon