From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150078.outbound.protection.outlook.com [40.107.15.78]) by sourceware.org (Postfix) with ESMTPS id 54C583857007 for ; Fri, 5 Aug 2022 15:47:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 54C583857007 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=G0/TvSgqEOy/n3/8nABfaa99VnVrOZDq2T7OzdDzsWtFqxot5f9yS3SDbfxjsCif/y9ghHVefj/YaXEPlL1GMikCikvnyTdKuPN2+aLOXLsDSvMZ6pzIGj55ncYvzR+zD6EkIIAKQnOnz2crRlw8eK8hF+/Wif4qHxTnvpz2kqpRcQZ/46EcddJ7peO/RjMKgtdxoWY5pB/GiykVAt4j+NVY3J9IJXHAWDlWrlsyC8KiY8k4lFYKaWTn5pcrCmrjlHNmb3ue3f8MlQyGDHs4d6q68X+rIM1kzNrGY65umiwb0gfOv6n9Os4Uj2E65k95kq5UaXQza34NY1LFU3XfMQ== ARC-Message-Signature: i=2; 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=Vk8z82Z6cqaQEkmiEUIYGPJG3vZtqOPXvAm0JgoOnS8=; b=krfoe2ki+h4migHxLehrzkuZ2shl6IiJN2wiu8LwKtU6ahaVYY74VAOy2zbJ+DI8teDj36CcbIKvpUKPTZ3ogC9grxYIX1GyRT1hYmI1kIYDXfXuepA9ERQKAsZQ2Da0VQZoFgt82GAMJRxR5o0NmCxKeAwXrGBPy9PlcI0bWNJpj8RE36v0g6Yet62fcYlhEwELoutZnYtE3hMk8+s9kw6zD+4rNFgGluH+tyGk5LilTIXdmf/nzQREPcBVdYIkoju7JE5bXN7ikVWr4Dshgy+jxxd/q2Gvx9pe1CCCbYQ11i4mB7QFlvKtMy6A07JVyWwkHYLD+1L0o4u4c83gFA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1, 1, smtp.mailfrom=arm.com] dmarc=[1, 1, header.from=arm.com]) Received: from FR3P281CA0101.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a1::10) by DB4PR08MB7959.eurprd08.prod.outlook.com (2603:10a6:10:38e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.15; Fri, 5 Aug 2022 15:47:10 +0000 Received: from VE1EUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a1:cafe::d3) by FR3P281CA0101.outlook.office365.com (2603:10a6:d10:a1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.4 via Frontend Transport; Fri, 5 Aug 2022 15:47:10 +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 VE1EUR03FT034.mail.protection.outlook.com (10.152.18.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16 via Frontend Transport; Fri, 5 Aug 2022 15:47:10 +0000 Received: ("Tessian outbound 2af316122c7a:v123"); Fri, 05 Aug 2022 15:47:10 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cbaaca05ee55c3f5 X-CR-MTA-TID: 64aa7808 Received: from e2d46347eeab.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B087E0BA-83CE-441A-8197-B6B1AC0E5A66.1; Fri, 05 Aug 2022 15:47:03 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e2d46347eeab.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 Aug 2022 15:47:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K1pN/+gYOu8LOGVOvkzadQT4c4wJtjdkJviFaqboPcooX6GVWGNYdIinZTED7B80PSZk4wptHPX62FGu5+1t8e/T9DyLTnRNj77M8YUQpsIig+SP9mVs4Fe6NdGyp+R2XggzEgq4kA4TsAIr7E/HIheLFKQeXAyQcy5cC3fhsy97EiwUnyOvw5nXUguPqFv5WR4T8HPuR3TELIZAsDLs3HAe3TeiNIV8v2syTvOS8Vbt3KjlWMK5q4O/ZuI+vByrmTA6Wc1BuxHx74vjb6hTiG/pxy13KsZFfCI/7DfQFabfITGI3K6owfDoRi1fb/uBVlEw8RwqWjRsNEeWLODApA== 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=Vk8z82Z6cqaQEkmiEUIYGPJG3vZtqOPXvAm0JgoOnS8=; b=mITq/M22+++am+SSEE7fDPuChNaeWV/CUEd2O8Nyr08BCGdpz1fckujVlpSRNlr8qrsDEy6qPIx87O71y8U7Fl8YwzzbcEsMh7/8NhtfQb3ZsNFlNkmSGa/gPd9XmOgq5dA/99SBWuigQJR7WXzdwVLPG0c0T1sCITBrE1oxvZFZXVNdVPVP+jqIQSFTH/pUcvTkL8zhtfeIJop8E9DVSIGUAGC+Z1fFR9aTXCDlAEkLg0obIZfwYMG/U/yhJo/9O+YZDDS+wb6llv63fIax3DHc2I/fsotwjPI4nRCh1n7t2Id4iF4Rz+UhtdU5riBi7KUmKsSQwvcmU2SI+hSdUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AM5PR1001CA0062.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::39) by GV2PR08MB8581.eurprd08.prod.outlook.com (2603:10a6:150:ba::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 5 Aug 2022 15:47:02 +0000 Received: from VE1EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:15:cafe::e) by AM5PR1001CA0062.outlook.office365.com (2603:10a6:206:15::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14 via Frontend Transport; Fri, 5 Aug 2022 15:47:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT036.mail.protection.outlook.com (10.152.19.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5504.16 via Frontend Transport; Fri, 5 Aug 2022 15:47:01 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Fri, 5 Aug 2022 15:47:00 +0000 Received: from e129171.cambridge.arm.com (10.1.28.26) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Fri, 5 Aug 2022 15:47:00 +0000 From: Luis Machado To: Subject: [PATCH] Update auxv cache when inferior pid is 0 (no inferior) Date: Fri, 5 Aug 2022 16:46:56 +0100 Message-ID: <20220805154656.47903-1-luis.machado@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220719144542.1478037-1-luis.machado@arm.com> References: <20220719144542.1478037-1-luis.machado@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: e31855d4-6d82-4fb7-0d0e-08da76f9c226 X-MS-TrafficTypeDiagnostic: GV2PR08MB8581:EE_|VE1EUR03FT034:EE_|DB4PR08MB7959:EE_ 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: WLaEmEQCHB8HVZwuisprNYGGuXZ1JQNSSet2sIumfBNY1ALMaCtb6jnnk0cLhNkv136z8aqZX8k3IB+FGXYOXu1GS3BzysUQ+ft+k3k2L2QuRf4rGueSSIct0WlmRQPhQDS5Xu1VN9uH7pP++qonrPOsn9inJFrJ5RN3mEG9K5wEaQ38STdpN2obhMv0ZNVur6yTwKrqcvNLdvjvKCDmQnS4Gy2YYloFaVKRC4V253fRCVjX+2nCwmC+oVAxDyaBIFrFv6x2VX7xm7M196Bg+DKpH5FqIcgqhJfPUVuHtKWfy03N7DR4vP5kQIwz89TTHQNi6mzDQow4o5iI04U/E6PmfUIbf7RKFPF4RQaWQKot4tktxxM7vgyCpjSSU9XGDeSrYR2hMCE2PxD1Kvfa1R1cUL4GD1fCToXqm2ewuAK6BCjHlb7r5yKfo7EHODDpBUavFDCDYKG8XuZrvL2yYgTOJdgrFU33m5rxX1JC9fZa025HB2ycKyssp64hWWwOo2siySDFeLPb53n1yu9ddJldFZ/dl7ihUYY8Ibxa3396s7X1tzpeyJUcaI5xE7AjLSXVQVovCzU7BpdFPQkqIlmq9VtUjOuy9MFZv0ML6h4sV1fVTYTQlKbTcpGt/FuNZg5Cz1go/4VjdIbtwe/3yOLQsEUsKHsv/sxwZhWXOcEThH3iOd0EqWxUmirTnef6QtspIjMBkG97c/m8FB7jJG6UJr7V7397dQvLwmv98NQdXZarmFg/T6HySF07+Tk67taS5TFyrHsadxYh7PmBUTunjyXQO1xqzcSXI2wL1pCZTGxJXxyQdkcSdjnmCI6Y88Tq4I15X6mq/CBcODrUlw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(136003)(376002)(39860400002)(346002)(36840700001)(40470700004)(46966006)(70586007)(83380400001)(36860700001)(2616005)(1076003)(47076005)(40460700003)(186003)(336012)(426003)(4326008)(6916009)(44832011)(316002)(5660300002)(41300700001)(7696005)(6666004)(478600001)(15650500001)(2906002)(26005)(36756003)(356005)(82310400005)(8936002)(81166007)(40480700001)(70206006)(82740400003)(86362001)(8676002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8581 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4833bb8a-e368-4e40-fb72-08da76f9bcfa X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NUVO3Fp2LYqBVYd0wr7DatwEH3+UOHQ7b/WXzcvhysUifv/iWFPcrhZeoSaP10jJKXP6wdCOCTtPndu/ZZk6nUyn6p09oMXa1a9roZDA5QM0Klqyo8eUPV7QyvgtsRuBPLiCmEeUn2Bwi8rrXrIFLHuwiBtes0laJXQ+uqBH5KIEbeoTTDZdI0wQIpps+7iG9U9j5I31ewGmNCahaqlsb2FHTh1EkMG2/RZT0vyF6YLoQJDko7MccUswk0872qxRJHNpKYEH3t42ITjEs3j6NZ4A+R/Doms/tXnsWgGW+qDdPI7YR8gER1xH5QDRdWpxAoH8yWQ+o0S24h4Bk0vMz37nHNu3CKryz3G0ZkMBrnArZLdVqZW07/xmylkI5ftXE8AF5xtiznRegHTMXqvROyjQk8g4/CoZtQRnk4SV2vr0SLmG5LQ5bhhLg/Ai4D9uIguS7ondqevWuhZn8Jn4MI2jBSR9xb+O0ZBZ0DsG+nBlMLcJJwUY/liKU0/IpaYvpmkMo9t0ox3tsmzPYf7cgrr4RuM0nTrNcXxz+pVp2PS8YKVrYiaCEN8QUjy5RwAdjIF0q41zWiFrvfL/MJjIFhUIxTZtypdY2s+vZEW6pjwWmH08VTeH6QMCRUJOVgSVNv+g55oLL5hi6tX3SjWtKQSrb85J3/0MhEE2Mhp154SZzrTJOci2yQKbGLBnQ1tJoi6yI0L7ZqVCg1KnRVHdgVG60cfGv/IGHvJwrRK8uHUx7LaXqwSGXpVqxVc5csY7oyb5cGc6GcKmd6GlpV8qcGbqKfgmNqNYhwKh0kngcERBBRX+xQmIOL/dlyIy0tT2 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:(13230016)(4636009)(396003)(346002)(136003)(39860400002)(376002)(36840700001)(46966006)(40470700004)(40460700003)(47076005)(186003)(426003)(107886003)(336012)(83380400001)(2616005)(82740400003)(478600001)(44832011)(36756003)(15650500001)(2906002)(5660300002)(36860700001)(82310400005)(6916009)(40480700001)(4326008)(81166007)(86362001)(1076003)(316002)(7696005)(26005)(8676002)(41300700001)(6666004)(70586007)(8936002)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2022 15:47:10.1460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e31855d4-6d82-4fb7-0d0e-08da76f9c226 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: VE1EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB7959 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 05 Aug 2022 15:47:15 -0000 While adding support for MTE corefiles and running the MTE corefile tests, I noticed a strange situation where loading the symbol file + core file through the command line has a different behavior compared to firing up GDB, loading the symbol file with the "file" command and then loading the core file with the "core" command. I tracked this down to gdb/auxv.c:get_auxv_inferior_data returning empty auxv data for pid 0, which gets cached. This is triggered by attempting to read auxv data for the exec target. In the early stages of reading the core file, we're still using inferior pid 0, so when we attempt to read auxv to determine corefile features, we get the cached empty data vector again. This breaks core_gdbarch setup. The fix, suggested by John Baldwin, prevents caching auxv data for pid 0. --- gdb/auxv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/auxv.c b/gdb/auxv.c index 6154988f6dd..33a829a7573 100644 --- a/gdb/auxv.c +++ b/gdb/auxv.c @@ -361,7 +361,7 @@ get_auxv_inferior_data (struct target_ops *ops) struct inferior *inf = current_inferior (); info = auxv_inferior_data.get (inf); - if (info == NULL) + if (info == NULL || inf->pid == 0) { info = auxv_inferior_data.emplace (inf); info->data = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL); -- 2.25.1