From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2074.outbound.protection.outlook.com [40.107.249.74]) by sourceware.org (Postfix) with ESMTPS id D864638582A4 for ; Fri, 17 Mar 2023 19:02:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D864638582A4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y0fI642RW8EY+RpRMCPYNpZ+nuOp2t1pyOdYqy0yfs8=; b=eK/HQvwawE9HM52YcOIEVXdxMKSTxI4f8zhzRRtVfBnQdAa4tTfYzsHI/XWDhoMVaY2lml4wj/8sG+XovtF46P35fwsYs4JEW7Y5uaR9c+QFmFC0OGJ3kXZiYZLpHivFKZR9RyGgo24U/pJugFG2uKtYuOljEO9jdnXVlzYHYfQ= Received: from DUZPR01CA0138.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bc::14) by DU0PR08MB7787.eurprd08.prod.outlook.com (2603:10a6:10:3b8::14) 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 19:02:37 +0000 Received: from DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4bc:cafe::ef) by DUZPR01CA0138.outlook.office365.com (2603:10a6:10:4bc::14) 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 19:02:37 +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 DBAEUR03FT039.mail.protection.outlook.com (100.127.142.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.10 via Frontend Transport; Fri, 17 Mar 2023 19:02:37 +0000 Received: ("Tessian outbound b29c0599cbc9:v135"); Fri, 17 Mar 2023 19:02:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b7415fd337e7090d X-CR-MTA-TID: 64aa7808 Received: from bd2f8eb546e7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FD380892-76AC-4456-9D1F-66AF5559E3BE.1; Fri, 17 Mar 2023 19:02:30 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bd2f8eb546e7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 17 Mar 2023 19:02:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTuZ1LoX+m7GyqAvXMvLDHNEwshEKBKSnOlFsDq+rjHL8pAVx/CwU5xqCHKuJvSGziaMxu1bTeBO3erMfHsHjsDHGNo4mMxatS5SxklholrcAnUw4Jn1e4Rsh2MfVBjeY6TMEcJRvYG/c9eoHNW6dQYawyH7lervINNJtSWAPkXIbk+qBX9XmNk3Qin9Q355cC75IrQ8RUIhhx4MroQMDcfZh8SRsZv9/CZJC7X6fHXLwG09jBoGrlJkAs+rNv4v39GJEPyBnx+J347fEYPLVbA7W/W+pBiP7WpM4YPRhGCuo2V3sgscoxowpTAi7wYImPBnKD1PU3ENtWWFHQhUkw== 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=Y0fI642RW8EY+RpRMCPYNpZ+nuOp2t1pyOdYqy0yfs8=; b=jcGkdDoONlRhsCXDOHcIXQVZCkT2yZgTYU+Z9DcZl3ktSu7y8TXiq+ORpsjLRY/VA/jKO7JIJX12XGCyGJXYjqHeZQCqhtyhU427HIjlhzwmXVvZwyAqoHK4xouxnrtzaxc/lVfJ+h3CwL7s2KQb0tSkOoa/4MV8pd/SB0JtY4dveLwyuEhV8c7+/wrzpTogJm9Fn1CTkpOJSF+nDZSI5Q6TF/Ge4szifN10gEvExShvCpyEQFL5GjxowcK5gA9QMGPcD3v7yy2Izn/nw/N3s5q+ucEFIHR8jallacougByoYw6YVmBrr5KAeLlMDqDlYf0CaYD7HBYPUHSxrgnAVw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y0fI642RW8EY+RpRMCPYNpZ+nuOp2t1pyOdYqy0yfs8=; b=eK/HQvwawE9HM52YcOIEVXdxMKSTxI4f8zhzRRtVfBnQdAa4tTfYzsHI/XWDhoMVaY2lml4wj/8sG+XovtF46P35fwsYs4JEW7Y5uaR9c+QFmFC0OGJ3kXZiYZLpHivFKZR9RyGgo24U/pJugFG2uKtYuOljEO9jdnXVlzYHYfQ= 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 AS4PR08MB7686.eurprd08.prod.outlook.com (2603:10a6:20b:505::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Fri, 17 Mar 2023 19:02:28 +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 19:02:27 +0000 Message-ID: <0df63795-2424-52e0-da93-92ab75a6d50f@arm.com> Date: Fri, 17 Mar 2023 19:02:17 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: Slow "symbol-file" when using GDB 12.1 on Windows hosts Content-Language: en-US To: Eli Zaretskii Cc: adrian.oltean@nxp.com, gdb@sourceware.org References: <070fbd13-e03c-a4e8-1372-3f7813b7db92@arm.com> <83sfe3ciwy.fsf@gnu.org> From: Luis Machado In-Reply-To: <83sfe3ciwy.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA9PR13CA0143.namprd13.prod.outlook.com (2603:10b6:806:27::28) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS4PR08MB7686:EE_|DBAEUR03FT039:EE_|DU0PR08MB7787:EE_ X-MS-Office365-Filtering-Correlation-Id: 555d0f64-7e4c-4cf2-c49f-08db271a2cc4 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: FSIXkY1kgZFR3f+pn1mWCNHUJ8hYSXJNg6KqWghpg7rwPYVzHuniG2yMrmOHVhYPuM5JuzeaNa1DyKATJ+TgS8MGns9YODtWxiQyMug1HGaJldWGwElO/tIOWd7ct9+DyNRavB6+gdYft4RsXwAN8x+ToV705h3UMAB8buEqjUgMiYUPmFRjaWc3VBr1dK5L5eQO3dn3wzSw5lKQrfciE3olPZOIimKJnSXFc2GRbuCtZX2NHvEgHTGffHSnVOhxAi8+b8og2SBL8Zemk2IiXgExbS/TwNWZcptpLhziRg1hyqVOybhqqkJAVA6hUEODspIRMH4IJ7hJUxcfilAiYEj1J/wGiOYZ68+h5vppcOftpYUqvzVyg9bxYWGv0v6A2OYjckwUJb+PAHWLTbvCKzSwNtPqGMWZZT0JRzKvoZB/gdrLc++uX38llt1O3RBQB5PQpf6PYmG9aiWObBnNRxHb/rVCwi7kf701OJG5/H1IcfJvDmPdnpnAYnKalkDIpfUqve5CZdV2n1VL/3TopPXkNPjaeYqAk+vJaCs+u0Gv8zqUXM02aE7GGlaJ//u0NbnRaX9Jtcw+0es3udLd+xZ1UyRkVNuwY1S9eBaMFYt4dGQYV3u8cJ5/kwFOBMpiQFEq4YT+2JhpTd8/NfmHZQLr+XK8SnVMIbsGc8dRNaY2eTZx9rii2m0zT/zM6qu6W88e+QoQoV78pElz3zLacBVYwVRbP3hLWa02xiNPpZd4aH/06HGyvNMMnxRfvoVj 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)(346002)(396003)(39850400004)(376002)(136003)(366004)(451199018)(8936002)(44832011)(5660300002)(41300700001)(4326008)(36756003)(31696002)(86362001)(38100700002)(2906002)(6916009)(8676002)(966005)(6486002)(6666004)(83380400001)(66476007)(26005)(186003)(478600001)(6506007)(2616005)(53546011)(6512007)(31686004)(66556008)(316002)(66946007)(43740500002)(45980500001)(460985005);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7686 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: DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e92b771c-c3ca-4926-6d45-08db271a268c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 49enXK6UyEdqbBsVFkSJQK9NPoz52SKxBPzi4cWmMvA8a9AKuNjuG63cgUDr6IRj5dx5Bj2Lj1eYufT0/ac0u8tDaIvw1lIGkkjdFNymqOO0fJA/f9dqrbA4Uk5+69Ul5WkZnyKWR3MN5gmvO0VsKPKi/GLYo9cUd4JNq4jAC7ZNIaY/mVzMEdDEc8SHUuMdmkVetrcHyWqP3B0TqK0Kh2cWJs5hSK197Mei73UmHF8pPAeyzX9oMoxqgBVSv0Ld4xn/f5RqLwcqBwxdeeA1K1g6Qs1WLRnppERZhPhmaIdc3nQyng5dxluuSVGevDIf2k6YNZdO3T6yUDhx4Wh1XWcpscnHEzqcFdRupao17qEZBbhVaaMDGJYjI66Q4336P4S9nVvm3rAPh+Lw+zyRWXqC/FqcRi11lmdEngNgz1A9PDL7WCx3BddOUPDrpI/rHFtEdlGS3zXJPjMGbyEowGPiF79SfgeUs4gmpTG2dycY0OgEGRnKkUSuG4iS5oEe5IDTXscT+7/tc32bXKM2Ll3IZBgN1c4JWyMalMx9J+VW2NohbjGzT0RwYQKDp0zmOJ3SvPjiXepNVu7N06iwAZwGZkaipw908XndFMvmc0sGMqWOXFLgSGR1nrz3BSZBOfspzStBl8kH5jRJFjpp24QUz0j0nmgMw/KQV7652XbTMuyAj/YLyzcKpxaPhpVHFkYwwaJN2EQGD4wAzJB4nHwPLNadE0jgrExgmYqz9sWU0bCYDnVALQ6o5oyiI1gW 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)(346002)(39860400002)(376002)(396003)(136003)(451199018)(36840700001)(40470700004)(46966006)(2616005)(186003)(966005)(47076005)(6486002)(83380400001)(478600001)(336012)(6666004)(316002)(8676002)(6512007)(26005)(6506007)(31686004)(70206006)(70586007)(53546011)(41300700001)(4326008)(36860700001)(44832011)(8936002)(6862004)(5660300002)(40460700003)(81166007)(2906002)(82740400003)(356005)(36756003)(31696002)(82310400005)(40480700001)(86362001)(43740500002)(460985005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2023 19:02:37.6626 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 555d0f64-7e4c-4cf2-c49f-08db271a2cc4 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: DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7787 X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 3/17/23 18:49, Eli Zaretskii wrote: >> Date: Fri, 17 Mar 2023 17:29:27 +0000 >> From: Luis Machado >> >> On 3/15/23 15:50, Adrian Oltean via Gdb wrote: >>> Hi, >>> >>> We recently upgraded the GDB version (from 10.3 to 12.1) in one of our IDEs and >>> found a painful performance issue on some Windows-based machines. I used >>> Process Monitor to identify the events that occur during a "symbol-file" invocation. >>> This is the command that now (GDB 12.1) seems to take ~2 seconds in the most >>> favorable case, and ~20 seconds in the worst case (on some machines). Note that >>> this happens with basic/small ELF files. Moreover, in GDB 10.3 execution of >>> "symbol-file" is almost instant. >>> >>> The relevant list of events reported by Process Monitor is the following: >>> Time of Day,Process Name,PID,Operation,Path,Result,Detail >>> 43:02.7, arm-none-eabi-gdb.exe, 13604, ReadFile, C:\MyIDE\workspace\MyProject\Debug\MyProject.axf, SUCCESS, "Offset: 272,405, Length: 512" >>> 43:02.7, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\MyIDE\workspace\MyProject\Debug , SUCCESS, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" >>> 43:02.7, arm-none-eabi-gdb.exe, 13604, QueryDirectory,C:\MyIDE\workspace\MyProject\Debug\MyProject.axf.dwp, NO SUCH FILE, "FileInformationClass: FileBothDirectoryInformation, Filter: MyProject.axf.dwp" >>> 43:02.7, arm-none-eabi-gdb.exe, 13604, CloseFile, C:\MyIDE\workspace\MyProject\Debug,SUCCESS, >>> 43:02.7, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\MyIDE\workspace\MyProject\Debug\Users\MyUsername\Documents\MyIDE\workspace\MyProject\Debug\, PATH NOT FOUND, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a" >>> 43:02.7, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\Users\MyUsername\Users\MyUsername\Documents\MyIDE\workspace\MyProject\Debug\, PATH NOT FOUND, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a" >>> 43:05.9, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\Windows\CSC\v2.0.6\namespace\lib, NAME NOT FOUND, "Desired Access: Read EA, Write EA, Read Attributes, Write Attributes, Delete, Read Control, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a" >>> 43:05.9, arm-none-eabi-gdb.exe, 13604, CreateFile, \\lib\debug\Users\MyUsername\Documents\MyIDE\workspace\MyProject\Debug\,BAD NETWORK PATH, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a" >>> 43:05.9, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\Windows\CSC\v2.0.6\namespace\lib, NAME NOT FOUND, "Desired Access: Read EA, Write EA, Read Attributes, Write Attributes, Delete, Read Control, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a" >>> 43:05.9, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\MyIDE\workspace\MyProject\Debug, SUCCESS, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" >>> 43:05.9, arm-none-eabi-gdb.exe, 13604, QueryDirectory, C:\MyIDE\workspace\MyProject\Debug\MyProject.axf.dwp, NO SUCH FILE, "FileInformationClass: FileBothDirectoryInformation, Filter: MyProject.axf.dwp" >>> >>> I see attempts to read files/folders that aren't actually present on my machine. Also, >>> a folder like "C:\Windows\CSC" (see "C:\Windows\CSC\v2.0.6\namespace\lib" above) isn't >>> accessible on my machine without admin privileges (I don't have this, according to >>> company policy). I observe that an attempt to access such a file/folder (or a network-specific >>> path) hangs GDB for a few seconds. Questions: >>> >>> 1. Is GDB trying to find debug symbols in all those folders? Or what's with them? >>> 2. What is the code from GDB that artificially builds all those paths? >>> 3. GDB 10.2 does not seem to access "C:\Windows\CSC\v2.0.6\namespace\lib", nor >>> "\\lib\debug\Users\MyUsername\...". Is this related to a recent change? Can someone >>> point to the relevant change in this case? >>> >>> 1. Is there a command to stop GDB from attempting to access those files/folders? >>> >>> Thank you, >>> Adrian >> >> I vaguely remember Eli ran into Windows-hosted gdb slowdowns before, but I'm not sure if it is related >> to what's been described here. >> >> Eli? > > That problem was solved. And it was with GDB 13, not GDB 12. > > I actually am not sure the fact that GDB looks in several directories > has anything to do with slowdown in symbol-file. The timeline > presented by the OP shows just one directory accessing which allegedly > takes 3 seconds, and I'm not sure what to make of that. In any case, > showing elapsed time on a modern system doesn't constitute a clear > evidence that there's some heavy processing involved. > > I guess what I'm saying is that more information is needed, perhaps > with profile-quality timing data, to see what is going on here and > what could cause a slowdown. Thanks for the feedback. There used to be an issue with ld (fixed in 2.37, https://sourceware.org/bugzilla/show_bug.cgi?id=27590) that caused gdb to keep expanding CU's, causing a lot of CPU and memory usage. We might need a bit more information on versions and tools involved to be able to provide some input.