From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id vjXnBV22FGS2dRIAWB0awg (envelope-from ) for ; Fri, 17 Mar 2023 14:50:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 0586C1E223; Fri, 17 Mar 2023 14:50:05 -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=h0ROM+6J; 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=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham 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 5897A1E0D3 for ; Fri, 17 Mar 2023 14:50:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BC2693850872 for ; Fri, 17 Mar 2023 18:50:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC2693850872 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679079002; bh=q2bfZhJfeWimM2dhW2vZIRNr46MStGdJG+bvm1An2sU=; h=Date:To:Cc:In-Reply-To:Subject:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=h0ROM+6JawTsGmD5jQg1o5koa28ZS3kKKikut78oVF4dI4QwJO4iOFfAceM5Is8oJ +3r8dTNOyg+ibcpdoB/ypNXOcv8/NduGO0j4zAiSkQU+sgLK1s2i8x6AzW39nluS1H rc1IHlQ0eZNkJAvdEndz/z/JkuFCPyYeXxweAlrg= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 412553851ABF for ; Fri, 17 Mar 2023 18:49:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 412553851ABF Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdF8v-0003GW-3N; Fri, 17 Mar 2023 14:49:33 -0400 Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdF8u-0001jm-JH; Fri, 17 Mar 2023 14:49:32 -0400 Date: Fri, 17 Mar 2023 20:49:33 +0200 Message-Id: <83sfe3ciwy.fsf@gnu.org> To: Luis Machado Cc: adrian.oltean@nxp.com, gdb@sourceware.org In-Reply-To: <070fbd13-e03c-a4e8-1372-3f7813b7db92@arm.com> (message from Luis Machado on Fri, 17 Mar 2023 17:29:27 +0000) Subject: Re: Slow "symbol-file" when using GDB 12.1 on Windows hosts References: <070fbd13-e03c-a4e8-1372-3f7813b7db92@arm.com> X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Zaretskii via Gdb Reply-To: Eli Zaretskii Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" > 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.