From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2057.outbound.protection.outlook.com [40.107.105.57]) by sourceware.org (Postfix) with ESMTPS id 8702E385021E for ; Mon, 20 Mar 2023 12:29:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8702E385021E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ph4IOK1H3CopMB6mFepNM5BGWZm6AqHC9nc6Jqnun4WqEtq8ZfErWvrg55sj20sIjfmVxflOguHGvgTq9ifbeaaduhcW0t4DpbsqZeAwwfE+rSmT5OUM/rqTQ0LX9WUVTjguuAyDSRKhV0wLIhIdJu3ZwzuYwxKqQcV+/N/1LbHr2nhhTBBT7WgSl/7iDcq0z44C0rGIy07fem4oSvY+d6GEVBpz8jM3pXOKZgPiPi3kgYX25i+MnlJZufY92TLD/719j/1ZMKYd8QzmvtfcrK3Wb4RRxBGBXaa1C4wO30ZZg5NISvTVsDNtMhGOChAM/NNCo6lXYzt8X98TSOHW1A== 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=nOw/kCy7U9sLC9+3G7Nm9eIaMnC9UrKxUSCNuFrmK0Y=; b=OHPoSsRX8hMFgPl6CIlLAp0QIm0nnANDCmytQqmm94lRa2/tttrV6fiq8MOp9u9sHcbm5sJfP3QKg3N/RKrvFlsi3LWX64YpCvzltsVPQx3Vu7TXjymzCE+zPfGYWnkkkHVDZHqInUATqGNaCQhG2QWSyKdW/XgoGiHhh8GLw515LrehStiYWEVJEK4VPfMbqJaAedfb7oEHJMwmRquRxX6KGIV+w9vuvzY23M5at+xBbPctRHILcViRx8R26TthAF2wPOs0fDMgcpYn0v1hdjNi5RmPzxMHjTo3QEw0IV5z1OF35VG6sDghY5d0n2RM6jgQiWCq8PP9o6x6+BcUDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nOw/kCy7U9sLC9+3G7Nm9eIaMnC9UrKxUSCNuFrmK0Y=; b=OPvk05gF2EsVIfZeXCJM93sIi+TNxYauj/g39Lf9uz/YZqeK8NpOdJRTgMvA1477Qqh4jynG5OPpne1sp7IaH0pw6tyu4Ymz9rEyycsQIl0kuhQwde49QJkrQn9yDuGcA91DdZ345Bc7nA9tx9BI9A/qstv3X2xxOq+zKMUpirE= Received: from AM6PR04MB4630.eurprd04.prod.outlook.com (2603:10a6:20b:17::21) by PA4PR04MB9463.eurprd04.prod.outlook.com (2603:10a6:102:2ab::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 12:29:30 +0000 Received: from AM6PR04MB4630.eurprd04.prod.outlook.com ([fe80::727e:eb1:4ede:272c]) by AM6PR04MB4630.eurprd04.prod.outlook.com ([fe80::727e:eb1:4ede:272c%5]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 12:29:26 +0000 From: Adrian Oltean To: Luis Machado , Eli Zaretskii CC: "gdb@sourceware.org" Subject: Re: Slow "symbol-file" when using GDB 12.1 on Windows hosts Thread-Topic: Slow "symbol-file" when using GDB 12.1 on Windows hosts Thread-Index: AQHZWyebO2VAG1DjRkCUH+JEd8AlcQ== Date: Mon, 20 Mar 2023 12:29:25 +0000 Message-ID: References: <070fbd13-e03c-a4e8-1372-3f7813b7db92@arm.com> <83sfe3ciwy.fsf@gnu.org> <0df63795-2424-52e0-da93-92ab75a6d50f@arm.com> In-Reply-To: <0df63795-2424-52e0-da93-92ab75a6d50f@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM6PR04MB4630:EE_|PA4PR04MB9463:EE_ x-ms-office365-filtering-correlation-id: 939a6e76-34b0-49fd-ca27-08db293ebe44 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jJShvm2Tj30PaQOjYOxvrPoa3aFHfCjpIoBFy0hxuUIrJ53L9Kzcq6eGK7QeT7ey7D6tIFD/XiC869Zr3edHBsclIbzD5VupG0Z0Qtc3wPoPryYX0V5FVDmJKAKngOyCh5/vVGC1yruyX09bppKZyB/9vCpoxeWPgiec/wxJPpILijyZnyxqPSCju1MeZlpRDUVLtJRZPCCQCmY2BrhyLZT049hEW71b1Nv4RweNxZE0fk28c7pK9RPbOSoI9xQ7TmFx6R+kHri8l4B4TatyKnV5IT7dm6bUPTsaZLDe6ZoIMtXd0/rJabfn039s4JVXz8GV9OHSQfiEXaM6o1hMpMaN/b4bNZN5mgH7RBXwiMH0tgcyD5qyGB2BAKnjgv4uM9Xxw2bIkS2hHkNltO9sy0mKb93WkMKDksO9aK8jC93AM8qdD0ulRu18MzZononblPnZ6lova2tAYjV1f6i7IUoWFlDm44571qdkuV2F+Rp/MWReWN1EeAlbiMn8/IT+4hmCvV+PFwv1kf0oDy9etNnSS5H0n3mlLeXAe2KcwT3ZvuIv1Az2riU+ikhu8z1CpxErmWyg4ShZGmUvu00GXwo2npGLtLWia0x37ny2DaTkHUupeEDD75ICCh3TPcl0h0IfPSAj6WqyYNLo/nOoOWMZCktpK3maa8My7L/yEChDEDWhZW54P6NXnCzDRCrM3zgjm8JLdvuOiPV7o81WRg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4630.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(376002)(136003)(396003)(346002)(39860400002)(451199018)(110136005)(6506007)(26005)(53546011)(966005)(8676002)(316002)(64756008)(4326008)(71200400001)(7696005)(83380400001)(66556008)(66476007)(9686003)(186003)(76116006)(478600001)(66946007)(66446008)(52536014)(5660300002)(44832011)(8936002)(2906002)(122000001)(41300700001)(38070700005)(66899018)(38100700002)(86362001)(33656002)(55016003)(460985005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1CFoxRzXClBZJtKjGuyhN2RQWsk293MvouTt29curSmncyNwTMRxjHURRt/X?= =?us-ascii?Q?lwV3H6Fgponil8AA8q4bcRlyWej0RCTqeijPoaNjvgeTU03N0N+RoS1Zi6qI?= =?us-ascii?Q?bTqq33jnzFHy8YcGYLkDNXBOtQN5x94ZczInbX0M9jARmpzSyJL9PvP2qrRu?= =?us-ascii?Q?VOFw/BPGPqk1L/nmnKIQ7T55HEArkRsZzzdk7TfZPfOd0jI2V4e2JjbnwB9/?= =?us-ascii?Q?FD6BYv8Q4CEtC32G0tAh7kspSmth3cM+K5BViaobokH7TKiDXkGJE8p4dv6u?= =?us-ascii?Q?8v4iTOBEpO/DMEti6/AWRBeD7xxNh996ezMUPVM0EXKLLDhCr3g57ooAt2bG?= =?us-ascii?Q?LkdZ87B4xIm4JtXXG5QRGRa0WlBfwclVqHcAYaweRkpr1HHVsHXuhf7KkXOk?= =?us-ascii?Q?3X7mW1cv6mJX7EF2K2IIrYgsEeV/onP5SyI3Pnt0y8CHuRj/U5i/gN07u+HO?= =?us-ascii?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xbtzc7pEsMN8hHtl?= =?us-ascii?Q?G8L/CFDe2VVw4X9UIm3WOMpwgLPuWUPYZNiuESiMf4D3PbH1i3JSxyEkTo8w?= =?us-ascii?Q?W9sgdxX4zBYNGpX7l8xnBu57ye6rWz0g8iS/tBo3l0w8T8DHNaT39tEW+pFu?= =?us-ascii?Q?8ZtW/+h0pZ+LmnLMkOn9DsNa9S4vbkHMhDOSDwoeBmaby8u1Sg/DWeKFTyxy?= =?us-ascii?Q?PCZ2jrEHoCgalbr9akX/Wb7bnG0TY7c/npbdP5bv?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 939a6e76-34b0-49fd-ca27-08db293ebe44 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2023 12:29:25.9635 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: stE8KAjW/HE3sHP/QrMLhz7V+WKlZq3EdcrDH9thgopfIcSMwbuA3DpAhYaIqAvrpX3BVhjVBmdpfdMJqaxwPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9463 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > -----Original Message----- > From: Luis Machado > Sent: Friday, March 17, 2023 9:02 PM > To: Eli Zaretskii > Cc: Adrian Oltean ; gdb@sourceware.org > Subject: [EXT] Re: Slow "symbol-file" when using GDB 12.1 on Windows host= s >=20 > Caution: EXT Email >=20 > 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 du= ring > 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 follow= ing: > >>> 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\M > yIDE\workspace\MyProject\Debug\, PATH NOT FOUND, "Desired Access: > Read Data/List Directory, Synchronize, Disposition: Open, Options: Direct= ory, > 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, Synchronou= s > IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, Allocation= Size: > 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 Contro= l, > 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 pace/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 Contro= l, > 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 thos= e > 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. >=20 > Thanks for the feedback. >=20 > There used to be an issue with ld (fixed in 2.37, > that caused gdb to keep expanding CU's, causing a lot of CPU and memory > usage. >=20 > We might need a bit more information on versions and tools involved to be > able to provide some input. Thanks for your comments. What kind of extra information would be helpful? = I mentioned in my previous email that the problematic GDB is v12.1 and the reference GD= B that seems fine is GDB v10.2. Releases can be downloaded from https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads Eli mentioned that the timestamps offered by Process Monitor are not releva= nt. However, I consider that the events and their timestamps are relevant when compared = to the ones generated by GDB 10. There's no attempt to access "C:\Windows\CSC" whe= n using GDB 10. If that file access wouldn't be attempted by GDB 12, I'm pret= ty sure there wouldn't be any slowdown. By the way, there's no spike in CPU/memory = usage when invoking "symbol-file" but, on my PC, "C:\Windows\CSC" is completely i= naccessible with my user account. Maybe you guys can also answer (some of) the questions from my initial emai= l? Thank you, Adrian