Subject: Re: bug#27315: Regression: `abbreviate-file-name' and `tramp-file-name-handler'

From: Alexander Shukaev <[email-masked]>
Date: Sun, 11 Jun 2017 13:30:14 +0200

On 06/11/2017 11:13 AM, Michael Albinus wrote:
> Alexander Shukaev <[email-masked]> writes:
> 
>> Hello,
> 
> Hi Alexander,
> 
>> In Emacs 26 series, I notice regression that has to do with
>> `abbreviate-file-name' and `tramp-file-name-handler'.  Here is how to
>> reproduce it:
>>
>> $ emacs -Q
>>
>> Paste the following to the "*scratch*" buffer:
>>
>> (setq-default
>>    frame-title-format
>>    '((:eval (list (user-login-name)
>>                   "@"
>>                   (system-name)
>>                   ":"
>>                   (abbreviate-file-name (or (buffer-file-name)
>>                                             (file-name-as-directory
>>                                              default-directory)))))))
>>
>> M-x eval-buffer
>> M-x find-file /sudo:root@localhost:~/hang
>>
>> will result in hanging with the "Sending password" message in
>> minibuffer.
> 
> I cannot reproduce it, using
> 
> --8<---------------cut here---------------start------------->8---
> GNU Emacs 26.0.50 (build 17, x86_64-pc-linux-gnu, GTK+ Version 2.24.31)
>   of 2017-06-10 built on detlef
> Repository revision: f361c54e6abc5ba5fa5ce6cc9734b5283e0e6aa3
> Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
> System Description:	Ubuntu 17.04
> --8<---------------cut here---------------end--------------->8---
> 
> A recent Emacs build is important, because I've fixed several Tramp
> issues recently, resulting from the Tramp syntax change.
> 
> If the problem persists, could you pls set tramp-verbose to 10, prior
> running your test? There will be a Tramp debug buffer then.

For the previous test, I've built Emacs from 'master' just a few commits 
before the one you referenced.  So, I've just rebuilt it again in order 
to capture your commit and the problem remains:

;; Emacs: 26.0.50 Tramp: 2.3.2-pre -*- mode: outline; -*-
;; Location: /usr/share/emacs/26.0.50/lisp/net/tramp.elc Git: 
973322704adf11cf2ac442e4d0b35eac71ace972
13:20:14.493721 tramp-get-connection-property (7) # ~root undef
13:20:14.493981 tramp-get-connection-property (7) # process-name nil
13:20:14.494130 tramp-get-connection-property (7) # process-name nil
13:20:14.494264 tramp-get-connection-property (7) # process-buffer nil
13:20:14.494415 tramp-get-connection-property (7) # process-buffer nil
13:20:14.494543 tramp-set-connection-property (7) # process-buffer nil
13:20:14.495003 tramp-maybe-open-connection (3) # Opening connection for 
root@host using sudo...
13:20:14.495676 tramp-get-connection-property (7) # login-args undef
13:20:14.495904 tramp-get-connection-property (7) # login-args undef
13:20:14.496217 tramp-get-connection-property (7) # process-name nil
13:20:14.496382 tramp-get-connection-property (7) # process-buffer nil
13:20:14.497168 tramp-set-connection-property (7) # vector 
(tramp-file-name sudo root nil host nil ~/xxx nil)
13:20:14.497357 tramp-maybe-open-connection (6) # /bin/sh -i
13:20:14.497496 tramp-get-connection-property (7) # vector 
(tramp-file-name sudo root nil host nil ~/xxx nil)
13:20:14.497652 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.497781 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.503446 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run t
#$
13:20:14.503622 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.503753 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.503893 tramp-wait-for-regexp (6) #
#$
13:20:14.504046 tramp-get-connection-property (7) # login-program undef
13:20:14.504188 tramp-get-connection-property (7) # login-args undef
13:20:14.504329 tramp-get-connection-property (7) # login-env undef
13:20:14.504466 tramp-get-connection-property (7) # async-args undef
13:20:14.504607 tramp-get-connection-property (7) # connection-timeout undef
13:20:14.504739 tramp-get-connection-property (7) # temp-file undef
13:20:14.504966 tramp-set-connection-property (7) # temp-file 
/tmp/tramp.2864657P
13:20:14.575140 tramp-maybe-open-connection (3) # Sending command ‘exec 
env SHELL=/bin/sh sudo -u root -s -H -p P""a""s""s""w""o""r""d"":’
13:20:14.575246 tramp-get-connection-property (7) # process-name nil
13:20:14.575320 tramp-get-connection-property (7) # remote-echo nil
13:20:14.575383 tramp-send-command (6) # exec env SHELL=/bin/sh sudo -u 
root -s -H -p P""a""s""s""w""o""r""d"":
13:20:14.575454 tramp-get-connection-property (7) # process-name nil
13:20:14.575524 tramp-get-connection-property (7) # chunksize nil
13:20:14.575587 tramp-set-connection-property (7) # last-cmd-time (22845 
10094 575567 749000)
13:20:14.575657 tramp-send-string (10) # exec env SHELL=/bin/sh sudo -u 
root -s -H -p P""a""s""s""w""o""r""d"":
13:20:14.575725 tramp-get-connection-property (7) # process-buffer nil
13:20:14.575917 tramp-set-connection-property (7) # first-password-request t
13:20:14.576072 tramp-process-actions (3) # Waiting for prompts from 
remote shell...
13:20:14.585091 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run t
Password:
13:20:14.585190 tramp-process-one-action (5) # Looking for regexp 
"\(.*\(user\|login\)\( .*\)?: *\)\'" from remote shell
13:20:14.585256 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.585319 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.585410 tramp-process-one-action (5) # Looking for regexp 
"\(^.*\(\(?:adgangskode\|contrase\(?:\(?:ny\|ñ\)a\)\|geslo\|h\(?:\(?:asł\|esl\)o\)\|iphasiwedi\|jelszó\|l\(?:ozinka\|ösenord\)\|m\(?:ot 
de passe\|ật khẩu\)\|pa\(?:rola\|s\(?:ahitza\|s\(?: 
phrase\|code\|ord\|phrase\|wor[dt]\)\|vorto\)\)\|s\(?:alasana\|enha\|laptažodis\)\|wachtwoord\|лозинка\|пароль\|ססמה\|كلمة 
السر\|गुप्तशब्द\|शब्दकूट\|গুপ্তশব্দ\|পাসওয়ার্ড\|ਪਾਸਵਰਡ\|પાસવર્ડ\|ପ୍ରବେଶ 
ସଙ୍କେତ\|கடவுச்சொல்\|సంకేతపదము\|ಗುಪ್ತಪದ\|അടയാളവാക്ക്\|රහස්පදය\|ពាក្យសម្ងាត់\|パスワード\|密[码碼]\|암호\)\).*:
13:20:14.585488 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.585547 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.585636 tramp-process-one-action (5) # Call ‘tramp-action-password’
13:20:14.585702 tramp-get-connection-property (7) # first-password-request t
13:20:14.585763 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.585825 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.586027 tramp-action-password (3) # Sending Password
13:20:14.586114 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.586221 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.586407 tramp-get-connection-property (7) # first-password-request t
13:20:14.590398 tramp-get-connection-property (7) # case-insensitive undef
13:20:14.590502 tramp-get-connection-property (7) # case-insensitive undef
13:20:14.602433 tramp-handle-file-name-case-insensitive-p (5) # Checking 
case-insensitive...
13:20:14.605291 tramp-get-connection-property (7) # tmpdir undef
13:20:14.605370 tramp-get-connection-property (7) # tmpdir undef
13:20:14.606211 tramp-get-file-property (8) # /tmp file-directory-p undef
13:20:14.606339 tramp-get-connection-property (7) # test undef
13:20:14.606403 tramp-get-test-command (5) # Finding a suitable ‘test’ 
command
13:20:14.606468 tramp-get-connection-property (7) # process-name nil
13:20:14.606534 tramp-get-connection-property (7) # process-name nil
13:20:14.606600 tramp-get-connection-property (7) # process-buffer nil
13:20:14.606669 tramp-get-connection-property (7) # last-cmd-time (22845 
10094 575567 749000)
13:20:14.606745 tramp-get-connection-property (7) # process-name nil
13:20:14.606810 tramp-get-connection-property (7) # remote-echo nil
13:20:14.606870 tramp-send-command (6) # test 0 2>/dev/null; echo 
tramp_exit_status $?
13:20:14.606933 tramp-get-connection-property (7) # process-name nil
13:20:14.606998 tramp-get-connection-property (7) # chunksize nil
13:20:14.607061 tramp-set-connection-property (7) # last-cmd-time (22845 
10094 607041 955000)
13:20:14.607130 tramp-send-string (10) # test 0 2>/dev/null; echo 
tramp_exit_status $?
13:20:14.607191 tramp-get-connection-property (7) # process-buffer nil
13:20:14.607287 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.607349 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.607494 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run t

13:20:14.607556 tramp-get-connection-property (7) # check-remote-echo nil
13:20:14.607619 tramp-get-connection-property (7) # check-remote-echo nil
13:20:15.608940 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

13:20:15.609266 tramp-get-connection-property (7) # check-remote-echo nil
13:20:15.609477 tramp-get-connection-property (7) # check-remote-echo nil
13:20:16.315663 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run t

Sorry, try again.
13:20:16.315895 tramp-get-connection-property (7) # check-remote-echo nil
13:20:16.316055 tramp-get-connection-property (7) # check-remote-echo nil
13:20:16.316324 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run t

Sorry, try again.
Password:
13:20:16.316490 tramp-get-connection-property (7) # check-remote-echo nil
13:20:16.316661 tramp-get-connection-property (7) # check-remote-echo nil
13:20:17.318118 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

Sorry, try again.
Password:
13:20:17.318402 tramp-get-connection-property (7) # check-remote-echo nil
13:20:17.318612 tramp-get-connection-property (7) # check-remote-echo nil
13:20:18.319246 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

Sorry, try again.
Password:
13:20:18.319513 tramp-get-connection-property (7) # check-remote-echo nil
13:20:18.319704 tramp-get-connection-property (7) # check-remote-echo nil
13:20:19.320281 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

Sorry, try again.
Password:
13:20:19.320568 tramp-get-connection-property (7) # check-remote-echo nil
13:20:19.320779 tramp-get-connection-property (7) # check-remote-echo nil
13:20:20.321264 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

Sorry, try again.
Password:
13:20:20.321480 tramp-get-connection-property (7) # check-remote-echo nil
13:20:20.321627 tramp-get-connection-property (7) # check-remote-echo nil
13:20:21.322053 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

Sorry, try again.
Password:
13:20:21.322268 tramp-get-connection-property (7) # check-remote-echo nil
13:20:21.322420 tramp-get-connection-property (7) # check-remote-echo nil
13:20:22.322885 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

Sorry, try again.
Password:
13:20:22.323102 tramp-get-connection-property (7) # check-remote-echo nil
13:20:22.323250 tramp-get-connection-property (7) # check-remote-echo nil
13:20:23.323822 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

Sorry, try again.
Password:
13:20:23.324111 tramp-get-connection-property (7) # check-remote-echo nil
13:20:23.324319 tramp-get-connection-property (7) # check-remote-echo nil
13:20:23.970086 tramp-file-name-handler (1) # Interrupt received in 
operation (file-directory-p /sudo:root@host:/tmp)

Sorry, try again.
Password:
13:20:23.970341 tramp-file-name-handler (1) # Interrupt received in 
operation (temporary-file-directory)

Sorry, try again.
Password:
13:20:23.970516 tramp-handle-file-name-case-insensitive-p (5) # Checking 
case-insensitive...failed
13:20:23.970695 tramp-file-name-handler (1) # Interrupt received in 
operation (file-name-case-insensitive-p /sudo:root@host:/)

Sorry, try again.
Password:
13:20:24.018825 tramp-get-connection-property (7) # case-insensitive undef
13:20:24.019047 tramp-get-connection-property (7) # case-insensitive undef
13:20:24.019163 tramp-handle-file-name-case-insensitive-p (5) # Checking 
case-insensitive...
13:20:24.040840 tramp-get-connection-property (7) # tmpdir undef
13:20:24.040981 tramp-get-connection-property (7) # tmpdir undef
13:20:24.045451 tramp-get-file-property (8) # /tmp file-directory-p undef
13:20:24.045662 tramp-get-connection-property (7) # test undef
13:20:24.045763 tramp-get-test-command (5) # Finding a suitable ‘test’ 
command
13:20:24.045868 tramp-get-connection-property (7) # process-name nil
13:20:24.045971 tramp-get-connection-property (7) # process-name nil
13:20:24.046073 tramp-get-connection-property (7) # process-buffer nil
13:20:24.046182 tramp-get-connection-property (7) # last-cmd-time (22845 
10094 607041 955000)
13:20:24.046299 tramp-get-connection-property (7) # process-name nil
13:20:24.046432 tramp-get-connection-property (7) # remote-echo nil
13:20:24.046583 tramp-send-command (6) # test 0 2>/dev/null; echo 
tramp_exit_status $?
13:20:24.046749 tramp-get-connection-property (7) # process-name nil
13:20:24.046918 tramp-get-connection-property (7) # chunksize nil
13:20:24.047087 tramp-set-connection-property (7) # last-cmd-time (22845 
10104 47035 387000)
13:20:24.047267 tramp-send-string (10) # test 0 2>/dev/null; echo 
tramp_exit_status $?
13:20:24.047433 tramp-get-connection-property (7) # process-buffer nil
13:20:24.047660 tramp-get-connection-property (7) # check-remote-echo nil
13:20:24.047825 tramp-get-connection-property (7) # check-remote-echo nil
13:20:24.048185 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run t

13:20:24.048326 tramp-get-connection-property (7) # check-remote-echo nil
13:20:24.048452 tramp-get-connection-property (7) # check-remote-echo nil
13:20:25.048848 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil

13:20:25.049180 tramp-get-connection-property (7) # check-remote-echo nil
13:20:25.049428 tramp-get-connection-property (7) # check-remote-echo nil
13:20:25.594045 tramp-file-name-handler (1) # Interrupt received in 
operation (file-directory-p /sudo:root@host:/tmp)

13:20:25.594268 tramp-file-name-handler (1) # Interrupt received in 
operation (temporary-file-directory)

13:20:25.594421 tramp-handle-file-name-case-insensitive-p (5) # Checking 
case-insensitive...failed
13:20:25.594594 tramp-file-name-handler (1) # Interrupt received in 
operation (file-name-case-insensitive-p /sudo:root@host:/)

13:20:25.704489 tramp-get-connection-property (7) # case-insensitive undef
13:20:25.704759 tramp-get-connection-property (7) # case-insensitive undef
13:20:25.704926 tramp-handle-file-name-case-insensitive-p (5) # Checking 
case-insensitive...
13:20:25.732731 tramp-get-connection-property (7) # tmpdir undef
13:20:25.732902 tramp-get-connection-property (7) # tmpdir undef
13:20:25.734523 tramp-get-file-property (8) # /tmp file-directory-p undef
13:20:25.734764 tramp-get-connection-property (7) # test undef
13:20:25.734885 tramp-get-test-command (5) # Finding a suitable ‘test’ 
command
13:20:25.735010 tramp-get-connection-property (7) # process-name nil
13:20:25.735136 tramp-get-connection-property (7) # process-name nil
13:20:25.735260 tramp-get-connection-property (7) # process-buffer nil
13:20:25.735394 tramp-get-connection-property (7) # last-cmd-time (22845 
10104 47035 387000)
13:20:25.735536 tramp-get-connection-property (7) # process-name nil
13:20:25.735663 tramp-get-connection-property (7) # remote-echo nil
13:20:25.735779 tramp-send-command (6) # test 0 2>/dev/null; echo 
tramp_exit_status $?
13:20:25.735900 tramp-get-connection-property (7) # process-name nil
13:20:25.736026 tramp-get-connection-property (7) # chunksize nil
13:20:25.736148 tramp-set-connection-property (7) # last-cmd-time (22845 
10105 736110 842000)
13:20:25.736274 tramp-send-string (10) # test 0 2>/dev/null; echo 
tramp_exit_status $?
13:20:25.736393 tramp-get-connection-property (7) # process-buffer nil
13:20:25.736572 tramp-get-connection-property (7) # check-remote-echo nil
13:20:25.736693 tramp-get-connection-property (7) # check-remote-echo nil
13:20:25.736934 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run t
Password:
13:20:25.737053 tramp-get-connection-property (7) # check-remote-echo nil
13:20:25.737173 tramp-get-connection-property (7) # check-remote-echo nil
13:20:26.737651 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run nil
Password:
13:20:26.737895 tramp-get-connection-property (7) # check-remote-echo nil
13:20:26.738098 tramp-get-connection-property (7) # check-remote-echo nil
13:20:27.298628 tramp-accept-process-output (10) # *tramp/sudo 
root@host* run t
Password:
sudo: 3 incorrect password attempts
13:20:27.298786 tramp-get-connection-property (7) # check-remote-echo nil
13:20:27.298912 tramp-get-connection-property (7) # check-remote-echo nil
13:20:27.302556 tramp-get-file-property (8) # / file-directory-p undef
13:20:27.302803 tramp-get-connection-property (7) # test undef
13:20:27.302917 tramp-get-test-command (5) # Finding a suitable ‘test’ 
command
13:20:27.303034 tramp-get-connection-property (7) # process-name nil
13:20:27.303150 tramp-get-connection-property (7) # process-name nil
13:20:27.303261 tramp-get-connection-property (7) # process-buffer nil
13:20:27.303403 tramp-file-name-handler (1) # Suppress received in 
operation (file-directory-p /sudo:root@host:/)
Password:
sudo: 3 incorrect password attempts
13:20:27.303564 tramp-get-file-property (8) #  file-truename nil
13:20:27.303686 tramp-flush-directory-property (8) #
13:20:27.303790 tramp-get-connection-property (7) # process-name nil
13:20:27.303909 tramp-flush-connection-property (7) # (tramp-file-name 
sudo root nil host nil nil nil) (process-buffer first-password-request)
13:20:27.304044 tramp-get-connection-property (7) # process-buffer nil
13:20:27.324727 tramp-get-file-property (8) # /tramp.28646GGW 
file-attributes-integer undef
13:20:27.324840 tramp-get-connection-property (7) # stat undef
13:20:27.324922 tramp-get-remote-stat (5) # Finding a suitable ‘stat’ 
command
13:20:27.325004 tramp-get-connection-property (7) # remote-path undef
13:20:27.325093 tramp-get-connection-property (7) # process-name nil
13:20:27.325177 tramp-get-connection-property (7) # process-name nil
13:20:27.325258 tramp-get-connection-property (7) # process-buffer nil
13:20:27.325347 tramp-get-connection-property (7) # process-buffer nil
13:20:27.325425 tramp-set-connection-property (7) # process-buffer nil
13:20:27.325533 tramp-file-name-handler (1) # Suppress received in 
operation (file-attributes /sudo:root@host:/tramp.28646GGW integer)
13:20:27.325649 tramp-get-file-property (8) #  file-truename nil
13:20:27.325733 tramp-flush-directory-property (8) #
13:20:27.325820 tramp-get-connection-property (7) # process-name nil
13:20:27.325904 tramp-flush-connection-property (7) # (tramp-file-name 
sudo root nil host nil nil nil) (process-buffer)
13:20:27.326000 tramp-get-connection-property (7) # process-buffer nil
13:20:27.326680 tramp-get-connection-property (7) # uid-integer undef
13:20:27.326765 tramp-get-connection-property (7) # id undef
13:20:27.326842 tramp-get-remote-id (5) # Finding POSIX ‘id’ command
13:20:27.326922 tramp-get-connection-property (7) # remote-path undef
13:20:27.327007 tramp-get-connection-property (7) # process-name nil
13:20:27.327089 tramp-get-connection-property (7) # process-name nil
13:20:27.327170 tramp-get-connection-property (7) # process-buffer nil
13:20:27.327258 tramp-get-connection-property (7) # process-buffer nil
13:20:27.327336 tramp-set-connection-property (7) # process-buffer nil
13:20:27.327439 tramp-file-name-handler (1) # Suppress received in 
operation (write-region  nil /sudo:root@host:/tramp.28646GGW nil silent)
13:20:27.327594 tramp-get-file-property (8) #  file-truename nil
13:20:27.327681 tramp-flush-directory-property (8) #
13:20:27.327766 tramp-get-connection-property (7) # process-name nil
13:20:27.327851 tramp-flush-connection-property (7) # (tramp-file-name 
sudo root nil host nil nil nil) (process-buffer)
13:20:27.327948 tramp-get-connection-property (7) # process-buffer nil
13:20:27.329841 tramp-handle-file-name-case-insensitive-p (5) # Checking 
case-insensitive...failed
13:20:27.329943 tramp-set-connection-property (7) # case-insensitive nil
13:20:27.350787 tramp-get-connection-property (7) # case-insensitive nil
13:20:27.350899 tramp-get-connection-property (7) # case-insensitive nil
13:20:27.350996 tramp-get-connection-property (7) # case-insensitive nil
13:20:27.354585 tramp-get-connection-property (7) # case-insensitive nil
13:20:27.354669 tramp-get-connection-property (7) # case-insensitive nil
13:20:27.354749 tramp-get-connection-property (7) # case-insensitive nil
13:20:29.006851 tramp-get-connection-property (7) # case-insensitive nil
13:20:29.007040 tramp-get-connection-property (7) # case-insensitive nil
13:20:29.007213 tramp-get-connection-property (7) # case-insensitive nil
13:20:29.031258 tramp-get-connection-property (7) # case-insensitive nil
13:20:29.031419 tramp-get-connection-property (7) # case-insensitive nil
13:20:29.031567 tramp-get-connection-property (7) # case-insensitive nil
13:20:29.418855 tramp-maybe-open-connection (3) # Opening connection for 
root@host using sudo...failed
13:20:29.419316 tramp-get-file-property (8) #  file-truename nil
13:20:29.419553 tramp-flush-directory-property (8) #
13:20:29.419797 tramp-get-connection-property (7) # process-name nil
13:20:29.420031 tramp-flush-connection-property (7) # (tramp-file-name 
sudo root nil host nil nil nil) (case-insensitive)
13:20:29.420344 tramp-get-connection-property (7) # process-buffer nil

NOTE: At some point I've simply pushed `C-g' to escape the hang.

Regards,
Alexander