all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Suhail Singh <suhailsingh247@gmail.com>, 73046@debbugs.gnu.org
Subject: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP
Date: Sat, 07 Sep 2024 16:36:42 +0200	[thread overview]
Message-ID: <87bk0zjzt1.fsf@gmx.de> (raw)
In-Reply-To: <86ttesyo1t.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Sep 2024 09:29:18 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> Thanks you.  So the problem seems to be symlinks, and specifically
> symlinks to directories.  Michael, what does Tramp do specially in
> these cases that could explain the slowdown?
>
>> The above observations seem consistent with Michael's comments above
>> regd. font-lock checks for "Broken Symbolink link" and "Symbolic link to
>> a directory".
>
> Michael, what do these checks entail, and why are they so
> CPU-expensive and take a lot of time with slow connections?

I made a test. In a remote directory I have created a cyclic symlink
"zzz", in order to see what Tramp does when running dired on the
directory. The additional actions are

--8<---------------cut here---------------start------------->8---
16:26:26.596764 tramp-send-command (6) # test -d /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:26.598277 tramp-wait-for-regexp (6) # 
tramp_exit_status 1
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:26.601447 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:26.620202 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:26.621815 tramp-send-command (6) # tramp_stat_file_attributes_with_selinux /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:26.701825 tramp-wait-for-regexp (6) # 
(("‘/home/albinus/tmp/zzz’ -> ‘/home/albinus/tmp/zzz’") 1 ("albinus" . 1000) ("albinus" . 1000) 1725715198 1725627151 1725627151 21 "lrwxrwxrwx" t 11020655 -1 "unconfined_u:object_r:user_tmp_t:s0")
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:26.727631 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:26.744351 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:26.763045 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:26.844666 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:26.870794 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:26.887610 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:26.906448 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:26.983946 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.006076 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.010734 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.030175 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.117633 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.139885 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.151833 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.171011 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.252462 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.275070 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.292574 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.311554 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.396961 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.419460 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.431578 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.451191 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.544333 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.567437 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.574681 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.594068 tramp-send-command (6) # (if test -h "/home/albinus/tmp/zzz"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /home/albinus/tmp/zzz 2>/dev/null; echo tramp_exit_status $?
16:26:27.681818 tramp-wait-for-regexp (6) # 
t
/home/albinus/tmp/zzz
tramp_exit_status 0
///dd77c20acbfe3e98bd0661ddf70b1f4a#$
16:26:27.701140 tramp-sh-handle-file-truename (10) # 
  backtrace()
  tramp-sh-handle-file-truename("/ssh:gandalf:~/tmp/zzz")
  tramp-sh-file-name-handler(file-truename "/ssh:gandalf:~/tmp/zzz")
  apply(tramp-sh-file-name-handler file-truename "/ssh:gandalf:~/tmp/zzz")
  tramp-file-name-handler(file-truename "/ssh:gandalf:~/tmp/zzz")
  file-truename("/ssh:gandalf:~/tmp/zzz")
  #f(compiled-function (end) #<bytecode 0x109ac555a7b5f865>)(4481)
  font-lock-fontify-keywords-region(4398 4482 nil)
  font-lock-default-fontify-region(4481 4482 nil)
  font-lock-fontify-region(4481 4482)
  #f(compiled-function (fun) #<bytecode 0x1b89b6a5409e3f3f>)(font-lock-fontify-region)
  jit-lock--run-functions(4481 4482)
  jit-lock-fontify-now(4481 4482)
  jit-lock-function(4481)
  end-of-buffer(nil)
  funcall-interactively(end-of-buffer nil)
  command-execute(end-of-buffer)
16:26:27.701222 tramp-sh-handle-file-truename (1) # File error: Apparent cycle of symbolic links for /ssh:gandalf:~/tmp/zzz
t
/home/albinus/tmp/zzz
--8<---------------cut here---------------end--------------->8---

15 times the "test -h" command - I guess, Tramp shall do cyclic link
detection better.

Best regards, Michael.





  parent reply	other threads:[~2024-09-07 14:36 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 14:24 bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP Suhail Singh
2024-09-05 15:56 ` Eli Zaretskii
2024-09-05 21:04   ` Suhail Singh
2024-09-06  5:40     ` Eli Zaretskii
2024-09-06 13:23       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-06 13:54         ` Eli Zaretskii
2024-09-06 14:09           ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-06 16:09             ` Eli Zaretskii
2024-09-06 17:47               ` Suhail Singh
2024-09-06 19:08                 ` Eli Zaretskii
2024-09-07  0:19                   ` Suhail Singh
2024-09-07  1:39                     ` Suhail Singh
2024-09-07  6:29                     ` Eli Zaretskii
2024-09-07  8:07                       ` Suhail Singh
2024-09-07 14:36                       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-09-07 15:07                         ` Eli Zaretskii
2024-09-07 17:35                           ` Suhail Singh
2024-09-08 11:30                             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-08 11:47                               ` Eli Zaretskii
2024-09-08 15:26                                 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-08 15:41                                   ` Eli Zaretskii
2024-09-08 16:46                                     ` Suhail Singh
2024-09-08 17:53                                       ` Eli Zaretskii
2024-09-10  8:10                                     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11  1:05                                       ` Suhail Singh
2024-09-11 11:50                                         ` Eli Zaretskii
2024-09-11 16:29                                           ` Suhail Singh
2024-09-11 16:38                                             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 17:25                                               ` Suhail Singh
2024-09-12 11:48                                                 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 14:13                                         ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 15:56                                           ` Suhail Singh
2024-09-13 23:17                                       ` Suhail Singh
2024-09-14  6:24                                         ` Eli Zaretskii
2024-09-14 14:25                                           ` Suhail Singh
2024-09-14 14:41                                             ` Suhail Singh
2024-09-14 15:03                                             ` Eli Zaretskii
2024-09-14 22:36                                               ` Suhail Singh
2024-09-15  5:55                                                 ` Eli Zaretskii
2024-09-15 14:23                                                   ` Suhail Singh
2024-09-20  9:54                                               ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-20 10:47                                                 ` Eli Zaretskii
2024-09-20 14:18                                                 ` Suhail Singh
2024-09-20 15:35                                                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-20 15:42                                                     ` Suhail Singh
2024-09-21  8:30                                                     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-21 14:06                                                       ` Suhail Singh
2024-09-14  7:07                                         ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14 14:39                                           ` Suhail Singh
2024-09-20  8:48                                             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 14:06                         ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-07 14:22                     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-07 17:58                       ` Suhail Singh
2024-09-08 11:26                         ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-08 15:09                           ` Suhail Singh
2024-09-08 15:19                             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-08 15:34                               ` Suhail Singh
2024-09-08 16:35                                 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 16:19                                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-06 16:56             ` Suhail Singh
2024-09-06 16:01         ` Suhail Singh
2024-09-06 15:46       ` Suhail Singh
2024-09-06 15:52       ` Suhail Singh
     [not found] <87v7yz1sw8.fsf@rutgers.edu>
2024-09-13 15:47 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-20 16:05   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-20 17:11     ` Jake Nelson via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-21  6:59       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bk0zjzt1.fsf@gmx.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73046@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=suhailsingh247@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.