GNU bug report logs - #73046
29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP

Previous Next

Package: emacs;

Reported by: "Suhail Singh" <suhailsingh247 <at> gmail.com>

Date: Thu, 5 Sep 2024 14:56:01 UTC

Severity: normal

Found in version 29.4

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Suhail Singh <suhailsingh247 <at> gmail.com>, 73046 <at> debbugs.gnu.org
Subject: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP
Date: Wed, 11 Sep 2024 16:06:46 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi Eli,

> 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

[...]

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

I've analyzed the case in detail. Tracing file-truename and
tramp-sh-handle-file-truename.

--8<---------------cut here---------------start------------->8---
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
======================================================================
1 -> (file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 -> (tramp-sh-handle-file-truename "/ssh:gandalf:~/tmp/zzz")
| 2 <- tramp-sh-handle-file-truename: !non-local\ exit!
1 <- file-truename: !non-local\ exit!
--8<---------------cut here---------------end--------------->8---

15 calls of file-truename (dired fontification), with 1 call of
tramp-sh-handle-file-truename each time. That sounds proper.

Tramp doesn't cache erroneous results, so it doesn't remember the
truename of "/ssh:gandalf:~/tmp/zzz". That's it, we can live with it I
guess.

Best regards, Michael.




This bug report was last modified 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.