Subject: bug#55832: 28.1; Emacs crashes when using tramp from helm in emacs-29

From: Michael Albinus <[email-masked]>
Date: Sat, 11 Jun 2022 21:27:40 +0200

Thierry Volpiatto <[email-masked]> writes:

Hi Thierry,

> Ah ok, I noticed I have always in ~/.emacs.d/tramp an UNKNOW entry for
> uid and gid, is it normal?

When the remote uid or gid cannot be determined, Tramp sets the default
value "UNKNOWN" (for the uid-string resp. remote-gid property), and -1
(for the uid-integer resp. gid-integer property). See
tramp-unknown-id-string and tramp-unknown-id-integer.

However, I would be surprised if these values are used for a "sudo"
connection. Checking my own ~/.emacs.d/tramp I find such entries,
indeed, for a "sudo" connection. Very strange. But although incorrect,
they haven't disturbed my use of Tramp.

After exiting Emacs, deleting ~/.emacs.d/tramp, and starting Emacs again
with a "sudo" connection, there arer proper values "root" and 0 in the
cached properties. Hmm, don't know where these values came from in
history, but I don't believe they should disturb Tramp. But who
knows. Perhaps you move the ~/.emacs.d/tramp file away (in order to use
it later if necessary), start a new Emacs instance, and see, whether it
still crashes with your scenario.

>> Sad. Since I cannot reproduce the problem locally, what happens if you
>> invoke "emacs -Q" similar to how I've done?
>
> I can't reproduce the crash using helm -P path/to/emacs though there is
> not much difference with my helm-find-files config, the difference comes
> I guess from the usage of normal emacs (or possibly only -q) and emacs
> -Q which affect tramp in some ways.
>
> What I would like to understand is why the crash appears AFTER
> tramp-cleanup-all-connections and not before on first shot.

Also a mystery to me.

If the removing of the ~/.emacs.d/tramp file does not help, you might
try the following settings:

--8<---------------cut here---------------start------------->8---
(setq tramp-verbose 10 tramp-debug-to-file t)
--8<---------------cut here---------------end--------------->8---

This increases the Tramp debug messages volume, and writes those
messages to disk at /tmp as they appear, under a file name like the
Tramp debug buffer name. So we have something to analyze even after
crash.

Well, reading the Helm sources, you'll better with setting
helm-tramp-verbose.

Best regards, Michael.