From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Suhail Singh Newsgroups: gmane.emacs.bugs Subject: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP Date: Sat, 07 Sep 2024 13:35:14 -0400 Message-ID: <87wmjn2wq5.fsf@gmail.com> References: <87o75241qh.fsf@gmail.com> <86plpi2ixa.fsf@gnu.org> <87seudke20.fsf@gmail.com> <8634md2vc2.fsf@gnu.org> <87h6asrk42.fsf@gmx.de> <86a5gk28ht.fsf@gnu.org> <87le0450x8.fsf@gmx.de> <865xr8228d.fsf@gnu.org> <87jzfofzcl.fsf@gmail.com> <8634mc1ty0.fsf@gnu.org> <87h6asl3hl.fsf@gmail.com> <86ttesyo1t.fsf@gnu.org> <87bk0zjzt1.fsf@gmx.de> <86a5gjy02i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33994"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Michael Albinus , suhailsingh247@gmail.com, 73046@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 07 19:37:11 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1smzN1-0008hu-2E for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Sep 2024 19:37:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smzMu-0001J7-Uo; Sat, 07 Sep 2024 13:37:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smzMt-0001Ig-Bh for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 13:37:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smzMr-0007Nb-6J for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 13:37:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=XVWSj2TfZoip73krmTZdBAZzN2i9qZCQoqOGf2S6pkA=; b=M0x7V3f3qI7vuLRt1AX8t33BxiiyW3fhJ+FdLftJjvkJTUvKkkaX8X5Al+HAsTYbjziWVdFp8xbhYFh7K0Ql4Nwvj1o3DD6g7vBhDThD339lBs/4GLZoUK/u7dtZM0qUyMTky11nFIwATKohogb8lrKwUyu17TGIJdwJHoXJZgZ5QBOg3NZjEZ4lmgepb5eRrwHnGuoQv16sZxVH/zY32zdLV1+7XcEebJ/rnOBjoNXK7OEVWV/iYaYXnRwiJi62SdoMHsLctOH/3AEXA4CzGYD3Ywlqo2SXGYj+MRAxjvy0rnCV92Qrs3MpTtVWiUGaHrxHpz3j6gzgYwdvsKiz0Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1smzMs-0001nO-6s for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 13:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Suhail Singh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Sep 2024 17:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73046 X-GNU-PR-Package: emacs Original-Received: via spool by 73046-submit@debbugs.gnu.org id=B73046.17257305966860 (code B ref 73046); Sat, 07 Sep 2024 17:37:02 +0000 Original-Received: (at 73046) by debbugs.gnu.org; 7 Sep 2024 17:36:36 +0000 Original-Received: from localhost ([127.0.0.1]:57565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smzMS-0001mZ-49 for submit@debbugs.gnu.org; Sat, 07 Sep 2024 13:36:36 -0400 Original-Received: from mail-yb1-f195.google.com ([209.85.219.195]:50192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smzMP-0001mJ-Ax for 73046@debbugs.gnu.org; Sat, 07 Sep 2024 13:36:34 -0400 Original-Received: by mail-yb1-f195.google.com with SMTP id 3f1490d57ef6-e1651f48c31so3457781276.0 for <73046@debbugs.gnu.org>; Sat, 07 Sep 2024 10:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725730526; x=1726335326; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=XVWSj2TfZoip73krmTZdBAZzN2i9qZCQoqOGf2S6pkA=; b=GS6PlQXJC2PbWVAeDBtZmEtdrOGIuw1BIJtTlLurQSR0+BFXV82MFbFmQn0kuiM47B piVLLEWm2C5ukiQhX00wAqyZzOnlR+690NWZiLWhJr8D1lf+l+ESuiXQgZfsV4rWz+kH t3bW/EFX4ARkTC+Wx3t8a8Q7NtAvu2trsnCahicKjI3kbHZ+pgJAUr5K7ZAsPSI3sRff O2nSbxwJMf6HgRAn4ZXTi09ckI52cNfSb9Ej8zQ5MC6ghFM5EgcQEEM1f0K6osEVyAP3 pU48i5p9KiYar+vkWOkTkQgkVLsMtLWT9wGXQX3m8Smbn7Js0QJe8CL6IVG8w6dmfHdk P34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725730526; x=1726335326; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XVWSj2TfZoip73krmTZdBAZzN2i9qZCQoqOGf2S6pkA=; b=Eh35E3EbAbmYqJ/kXzZUu9DkxjN1tl3rWubebe8jOwzQ2szenSwfko2ZKhRjnK0kom QqVqhY5rcRM8hGLcdnLlyAKsjdNFoXTTQjqgL5bbHJodc6nE34jgO8Ol9XDAmu1vGvwR Im8vT26l9wx7KmzAxQHMKiahrKNyU9OkKFtnSOYAqvwpHdjzo9QbY6/IQtxTJKdvqGgV YPrbNrVoiFczhbjSb1CmUMZDgPyJ0fldKwYmp7pdsg0vybDUY6kA2cnMzn8QQQIXVM8N LEX76KnxkAf/0SX4RS8KNESVWBUkszM1fgnWAzv/wIyPppWKxaE+qIgRwzHT1Lo/llzg qhEw== X-Forwarded-Encrypted: i=1; AJvYcCWAl59RTm2k2alnhZslyG2QEuLDvAzrc3jvkDJ5euUGSznz6QADWAr2HTsaVUE80rOYlGFigA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yydk/yaJyjCP+lVEs5ztoyMG2jz6l+UaTR33B1I50cDQyii0Xgb v3RLRe/lEhjlTA5rOfSGPdZVNYuFIrykDmATCCpSbyeHyBlmD/4zElsR1CMB X-Google-Smtp-Source: AGHT+IE13yFZfplqW7LB7OfOpyyww6ALYIsBHEsKwMVbzjPECiHbwBEq90mVY3qwcq4xUPnltqJRUw== X-Received: by 2002:a05:6902:2301:b0:e13:d0af:b1f8 with SMTP id 3f1490d57ef6-e1d346b00a2mr7432815276.0.1725730526179; Sat, 07 Sep 2024 10:35:26 -0700 (PDT) Original-Received: from gnus ([65.94.70.53]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45822f6bb0dsm5678161cf.72.2024.09.07.10.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 10:35:25 -0700 (PDT) In-Reply-To: <86a5gjy02i.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Sep 2024 18:07:17 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291404 Archived-At: Eli Zaretskii writes: >> 15 times the "test -h" command - I guess, Tramp shall do cyclic link >> detection better. > > I agree. But that only explains the time delay, no why Emacs is > consuming 100% of CPU, right? Waiting for the network should not > consume CPU, unless I'm missing something. > > Also, Suhail Singh says that there's a significant delay when there > are valid symlinks, in which case I don't expect Tramp to issue the > same command 15 times, right? Yes, while there are clearly inefficiencies in cyclic link detection, that's not the situation for the reproducer I shared. Font-locking symlinks (broken, not broken; to files, to directories) trigger the issue even without introducing cyclic references. For what it's worth, as I shared in an earlier exchange, the profiler-report seemed to point the finger to `tramp-wait-for-regexp': | Func in font-lock check | TRAMP handler | |-------------------------+----------------------------------------------------------------------| | `file-truename' | `tramp-sh-handle-file-truename' -> ... -> `tramp-wait-for-regexp' | | `file-exists-p' | `tramp-sh-handle-file-exists-p' -> ... -> `tramp-wait-for-regexp' | | `file-directory-p' | `tramp-sh-handle-file-directory-p' -> ... -> `tramp-wait-for-regexp' | Unless I misinterpreted the profiler output, something in/about `tramp-wait-for-regexp' results in the 100% CPU usage. -- Suhail