From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QVdqHQRw3mn+MBcAWB0awg (envelope-from ) for ; Tue, 14 Apr 2026 12:49:08 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=FRhNbeFU; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 66E4B1E0C3; Tue, 14 Apr 2026 12:49:08 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 209311E04F for ; Tue, 14 Apr 2026 12:49:07 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 9F2DA4BA2E13 for ; Tue, 14 Apr 2026 16:49:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F2DA4BA2E13 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=FRhNbeFU Received: from SJ2PR03CU001.outbound.protection.outlook.com (mail-westusazon11012069.outbound.protection.outlook.com [52.101.43.69]) by sourceware.org (Postfix) with ESMTPS id 188564BA5439 for ; Tue, 14 Apr 2026 16:48:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 188564BA5439 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 188564BA5439 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=52.101.43.69 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776185320; cv=pass; b=nMmJL1BkbdGCH1akxQQjRoqR1Z8MMwP35gV+3/JZ6oYyl0MWyV8lc+rvxN3rUQt1xZ+MpHId72oFZ3k1FFH0tEczWzWqcvpTyVbWqlROc3Qj+OSnm26BKk9wh0ksVtMBznAFQJKtitlvxSVlOuYIdTscnPLGcbculZL6x79EwD0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776185320; c=relaxed/simple; bh=XqakkxNrrRnENdgJr86pICWC5duTG3hDvsVVcLCTS2E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=xAdNcnktleuttH6lAcSOYpIz5Ws6lnTTIk/YIKASxNremxr2oY9oDYyd0txpQlnU998HgrwWMc5dz+lTk9XeJZhrDgD7tqB5IufMecsW5jJ048HQu745cKAQV1UtAylK4IvUO5LGKwtMCXpP2PAwziYrfHnhdsciWDADYJWiw6I= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 188564BA5439 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wOtTAOTaYPV1SatgTou6FRMWopKRxtfqW75QwgtNgdK+cV6i4czDPS5D37tKpUm7+4ak9wG0GyXgPWFGf/p+rtUBHHiWeI/UP/AXH7SnZmAolFrd8gp2Ubi8v7v7S4gY5iL56v3kvucrqTJ6TUQlQBsgGixn7OGWSpfqhcMsOjyYh0AC0ouH9qW93Y0buvZ7+KnTsZhNJ7PKVdGf+GUhNBpyV3ENCx7iA0Gg+I8cvUFTMDOpRKQ4O5UdniDnwxT8siY1WNWShr9Bfl0LJh/spPKHa/KCVnIauKMzs2Jkg6O9z2CrWiIOPM//OvyiMuf0VJqeY7OeS3XK+pKfmTdu6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Tu/s24+1Lz1kmWSIf/4NtbYLHHz37fENDtijMB7990c=; b=LYu1PKNJTQN6Ks4vZphjrFKoosK00Y+IBiT+t70Be7Yij6yK0DHQNowgrSEE9QDyFN/xsa/SnfEQB/z1AFlzm2Y612eti3V9NFvlPXIpJv+ffo5jr54pBf3jPu4KnEnVts6Tm8UXD8gBszSR231Lz6s5xXO49KxkpcmLSpqcmTlm12oNatniFGvx3He58wfBDKtI5tPHemqQDwI6TBLd8II26GrnpkBxyinWRQMBVkhuGsNTX1NX2ebBE1XDWlS+7PxMoDue2BRSQDmS/xbMXS/aDx9nzj+449pJ1O6IGtvB7t0gVsVBgkKKn/5/DjcRNSlc+3gzYGh/dLKg+WshCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tu/s24+1Lz1kmWSIf/4NtbYLHHz37fENDtijMB7990c=; b=FRhNbeFUzyQWWsuHLg3T4aJj35sSfF4ix3zwuTMs4pc1O6M28QsuLNMrRmj7tyszLnlIFccux99/Uz2ZT5S1V/BMmTr72t6nbc1NOYfVhP27ayXJ2Hnx4YDHmh9vG2Jyj3xxk0Jg6YCXlBPqVHDkZyWASTuhBGXL1w7IvTvk0Oc= Received: from SA0PR11CA0050.namprd11.prod.outlook.com (2603:10b6:806:d0::25) by DM6PR12MB4467.namprd12.prod.outlook.com (2603:10b6:5:2a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9818.20; Tue, 14 Apr 2026 16:48:32 +0000 Received: from SN1PEPF0002636D.namprd02.prod.outlook.com (2603:10b6:806:d0:cafe::fd) by SA0PR11CA0050.outlook.office365.com (2603:10b6:806:d0::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.48 via Frontend Transport; Tue, 14 Apr 2026 16:48:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17 via Frontend Transport; Tue, 14 Apr 2026 16:48:31 +0000 Received: from ctr-s27-hpe-19.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Tue, 14 Apr 2026 11:48:31 -0500 From: Bratislav Filipovic To: CC: Bratislav Filipovic Subject: [PATCH] gdb/testsuite: fix dw2-entry-pc.exp with ASLR Date: Tue, 14 Apr 2026 16:48:03 +0000 Message-ID: <20260414164814.564571-1-bfilipov@amd.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|DM6PR12MB4467:EE_ X-MS-Office365-Filtering-Correlation-Id: 262dcd42-8114-438e-35a7-08de9a45a976 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700016|82310400026|376014|56012099003|18002099003; X-Microsoft-Antispam-Message-Info: i76+eTeRnKOww1YRnTOgW/O3JAOxC5CgpiJgItJ64xPRLA/J2D1pME7Y3Nyr2uvQvkhQo6LHiOppPRGWX+Odf64tiGyOjjNIzBXakCpUT7J4nGMowQ8M50U/Tg6ov2iM2RScOeEk8uH/SxTzn2TRCG9cE6zHiB3jgG7Z1Q3LcJpgs6xwGM5jSIuKxhPmBu7vgyIoEL4tvjH/SFEFNT1Kz74u8B2GeUw37bXV4Ybu1bcS0N839OTmkgFqME1IOJBazKLbb+JsALZjvvihvZBb5J80yrCuWc6MkeY1awuivq4Bm2mALRGqquNwXgd1eLsLms3L3pOHnad/S/ejEx1AZOa+QiUIiUBjlNDL/GIQQjEEgiJc/1b/T0mp2l+Era+kdIlW94evf/P4YDAgKZkMtGH85NyrclbwWVQIgt+H+yv+toL2tUJFxRgBGbQpemkM/oBmmUOcLJ3SVI6cnBsr7xphVdmdIQuNTuwkboKO8QQkxQPUDL/6vKHA3R74/KlbH/8v2xWvXXvzmvKJAruGcUwYwZYePLojCIG1azWea06kCSYO056OB6QyPkmJU+1VkaXfz/bVrOO1tCUNz7LgXyovU02vAuTVNR/fLl8Ivr6KdU4NGd1hxIAXPIdWSudCAVT3Bik5dDY5/vHzwUfubPoq1M6nPFYpVNR4YSR2cNnpVW9GjJxJO38NlQ1Lu0Ghw8jcRuPHVioAklZBTlGVWCD1X8GU/3PH+y5Lx14YqsIEy72QhoKmeY3S3amqaEHwhNYLsRpjssQMnJ2bXGRSVQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(36860700016)(82310400026)(376014)(56012099003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wVmWViovHfmPLJA4LMuc+fCO4G7BnpkjHt+6m2PTbF2KixcH+Y3CPz/eDj8ykkMOHEHuHRBdNHPVGYqBbQWI50jNMvpVG+MgSknfTffeb3Tvi6px93QIfCFbQ4vBFG0VzW2PIkknsUuaFN0/07y98x5uIhnSJ3c9H8hK3zqnoqGkdvRxtnyotVS1q/SEczkWiVKS0CxEvLttBiRa5HtSRSaE4BGlB2LPWv4C4NEfWrg52eQffDXg9EEYUBcmaUTfMB/7iL0paISIwbGWRgMMHWPNx6uTdCJDywMPhG7XzCchbmQuGMf73fR+UEh3kTUPECp8+BWypXS4/OeEa0xUZXwzwNTshwhsWA8x1j52S7EFTnWcs4+vdzZ42K1P4UPUP7GwBiGh6ch0Qd6WOS2uK1BSHUY2oUmtukrk+jfRSFDZRy2L4+l3TwnA8UkCoB8f X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2026 16:48:31.8973 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 262dcd42-8114-438e-35a7-08de9a45a976 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4467 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 Following Simon Marchi's fix for dw2-empty-inline-ranges.exp [1], this test exhibits the same failure pattern when running in an environment where GDB can't disable address space randomization (such as in a container where that capability is removed) with a toolchain generating position-independent executables. The test does a first run to grab addresses of labels and function boundaries (foo_middle, foo_start, foo_end, and range labels). It then crafts DWARF using these addresses across multiple test iterations. When the executable is PIE and ASLR is active, the addresses in each subsequent run don't match the addresses from the initial run. The failure manifests in the 'maint info blocks' output comparisons, where the expected addresses (from the first run) don't match the actual addresses in the test runs. The simplest fix, following Simon's approach, is to use "nopie" when building the binaries. This doesn't affect the effectiveness of the test, which is exercising different ways DW_AT_entry_pc can be expressed in DWARF. Also, with a non-PIE executable, it is no longer necessary to run the inferior before grabbing the addresses in the initial run, as they are stable. So remove that runto_main call. [1] https://inbox.sourceware.org/gdb-patches/20260205204257.422150-1-simon.marchi@efficios.com/ --- gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp b/gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp index 441aa0fde1d..f7cc7f7c067 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-pc.exp @@ -28,11 +28,7 @@ standard_testfile get_func_info foo if { [prepare_for_testing "failed to prepare" ${testfile} \ - [list ${srcfile}]] } { - return -1 -} - -if {![runto_main]} { + [list ${srcfile}] {debug nopie}]} { return -1 } @@ -83,7 +79,7 @@ proc get_next_suffix {} { proc build_and_runto_main { suffix asm_file } { if {[prepare_for_testing "failed to prepare" "${::testfile}-${suffix}" \ - [list $::srcfile $asm_file] {nodebug}]} { + [list $::srcfile $asm_file] {nodebug nopie}]} { return false } -- 2.43.0