GNU bug report logs - #57676
29.0.50; Tramp: Unable to close vterm buffer with remote default-directory

Previous Next

Package: emacs;

Reported by: James Ferguson <james <at> faff.org>

Date: Thu, 8 Sep 2022 12:49:01 UTC

Severity: normal

Merged with 57572

Found in version 29.0.50

Fixed in version 29.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57676 in the body.
You can then email your comments to 57676 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#57676; Package emacs. (Thu, 08 Sep 2022 12:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Ferguson <james <at> faff.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 08 Sep 2022 12:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: James Ferguson <james <at> faff.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50;
 Tramp: Unable to close vterm buffer with remote default-directory
Date: Thu, 8 Sep 2022 08:48:35 -0400
[Message part 1 (text/plain, inline)]
Perhaps what I'm doing is misguided, but it used to work before I
recently rebuilt (to master @ e1282c8c66): I open (vterm)
buffers to remote hosts, and set `default-directory` on them to be
'/sshx:<host>:.' for convenience when opening files from that buffer.

When trying to close the terminal one way or another (with debug-on-error)
I now get:

Debugger entered--Lisp error: (file-error "File ‘.’ must be absolute")
  signal(file-error ("File ‘.’ must be absolute"))
  tramp-error((tramp-file-name "sshx" nil nil "4x02" nil "." nil)
file-error "File `%s' must be absolute" ".")
  tramp-file-name-unify((tramp-file-name "sshx" nil nil "4x02" nil "." nil)
".")
  tramp-get-file-property((tramp-file-name "sshx" nil nil "4x02" nil "."
nil) "." "file-truename")
  tramp-flush-file-properties((tramp-file-name "sshx" nil nil "4x02" nil
"." nil) ".")
  tramp-flush-file-function()
  kill-buffer(#<buffer Terminal-4x02 volta <at> 4x02 (10.0.154.60) - byobu>)
  (if (and vterm-kill-buffer-on-exit (buffer-live-p buf)) (kill-buffer buf))
  (let ((buf (process-buffer process))) (run-hook-with-args
'vterm-exit-functions (if (buffer-live-p buf) buf nil) event) (if (and
vterm-kill-buffer-on-exit (buffer-live-p buf)) (kill-buffer buf)))
  vterm--sentinel(#<process vterm> "finished\n")

And I am unable to close the buffer.



In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.20, cairo version 1.16.0) of 2022-09-07 built on jf-laptop
Repository revision: e1282c8c66f228d45b03fd7109ffe6bc7ea201a9
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.5 LTS

Configured using:
 'configure --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: VTerm

Minor modes in effect:
  openwith-mode: t
  org-roam-db-autosync-mode: t
  corfu-doc-mode: t
  ws-butler-global-mode: t
  winner-mode: t
  which-key-mode: t
  vertico-mode: t
  global-tree-sitter-mode: t
  prescient-persist-mode: t
  projectile-mode: t
  async-bytecomp-package-mode: t
  dired-async-mode: t
  minions-mode: t
  marginalia-mode: t
  textsize-mode: t
  direnv-mode: t
  global-corfu-mode: t
  corfu-mode: t
  pixel-scroll-precision-mode: t
  shell-dirtrack-mode: t
  savehist-mode: t
  save-place-mode: t
  recentf-mode: t
  global-hl-line-mode: t
  global-auto-revert-mode: t
  electric-pair-mode: t
  delete-selection-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/james/.emacs.d/elpa/dpkg-dev-el-20190824.2314/debian-autoloads hides
/home/james/.emacs.d/elpa/debian-el-20211006.1939/debian-autoloads
/home/james/.emacs.d/elpa/transient-20220717.1713/transient hides
/home/james/src/emacs/lisp/transient
/home/james/.emacs.d/my-packages/custom hides
/home/james/src/emacs/lisp/custom

Features:
(shadow sort expand-region text-mode-expansions cc-mode-expansions
the-org-mode-expansions python-el-fgallina-expansions
er-basic-expansions expand-region-core expand-region-custom mail-extr
emacsbug message yank-media rfc822 mml mml-sec epa gnus-util mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail mail-utils
mule-util lsp-pyright lsp-ui lsp-ui-flycheck lsp-ui-doc goto-addr
lsp-ui-imenu lsp-ui-peek lsp-ui-sideline flycheck jka-compr let-alist
lsp-ui-util lsp-mode lsp-protocol xref spinner network-stream
markdown-mode imenu ht f f-shortdoc shortdoc ewoc epg rfc6068 epg-config
vterm bookmark face-remap color term disp-table ehelp vterm-module
term/xterm xterm cursor-sensor myremote openwith my-org-roam
org-roam-dailies org-roam-migrate org-roam-log org-roam-mode inline
org-roam-capture org-roam-id org-roam-node org-roam-db org-roam-utils
org-roam-compat org-roam org-capture org-attach org-id ox-reveal ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-md ox-latex ox-icalendar org-agenda
org-refile ox-html table ox-ascii ox-publish ox org-element avl-tree
generator ob-async org-variable-pitch org org-macro org-footnote
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs ob-http ob-http-mode ob-python
py-isort python-black reformatter python ob-shell ob-ditaa ob-plantuml
ob-dot ob ob-tangle org-src ob-ref ob-lob ob-table ob-exp ob-comint
ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol org-keys oc
org-compat org-macs org-loaddefs find-func cal-menu calendar
cal-loaddefs emacsql-sqlite url-http url-auth mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm puny emacsql
emacsql-compiler magit-section benchmark compat-27 compat-26
display-fill-column-indicator flyspell ispell highlight-symbol cl
yasnippet-snippets yasnippet corfu-doc faff-theme init xterm-color
ws-butler winner which-key vterm-autoloads vertico tree-sitter-langs
tree-sitter-langs-build tar-mode arc-mode archive-mode tree-sitter-hl
tree-sitter tree-sitter-load tree-sitter-cli tsc tsc-dyn tsc-dyn-get
tsc-obsolete s prescient comp comp-cstr warnings projectile skeleton
find-dired dired-x dired-filetype-face async-bytecomp dired-async
dired-aux async dired dired-loaddefs lisp-mnt ibuffer-vc ibuf-macs
ibuf-ext ibuffer ibuffer-loaddefs thingatpt project orderless minions
compat compat-macs marginalia hydra lv grep-a-lot advice textsize direnv
diff-mode dash corfu pcase dotenv-mode server pixel-scroll cua-base
edmacro kmacro tramp-sh docker-tramp tramp-cache time-stamp tramp
tramp-loaddefs trampver tramp-integration cus-edit pp icons files-x
tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp
format-spec savehist saveplace recentf tree-widget wid-edit grep compile
text-property-search comint ansi-color ring hl-line autorevert
filenotify elec-pair delsel cus-load straight-autoloads cl-extra
help-mode straight use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core derived finder-inf ede/auto eieio-base
atomic-chrome-autoloads dap-mode-autoloads dpkg-dev-el debian-el
embark-consult-autoloads consult-autoloads embark-autoloads
company-autoloads lsp-docker-autoloads lsp-ui-autoloads
lsp-mode-autoloads magit-autoloads marginalia-autoloads
markdown-mode-autoloads org-modern-autoloads org-roam-autoloads
magit-section-autoloads async-autoloads js2-mode-autoloads rx
flycheck-autoloads transient-autoloads treemacs-autoloads
projectile-autoloads typescript-mode-autoloads compat-autoloads info
yaml-autoloads yasnippet-snippets-autoloads package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile cconv url-vars cl-loaddefs cl-lib
rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 1235783 559015)
 (symbols 48 57151 55)
 (strings 32 306661 80560)
 (string-bytes 1 11340219)
 (vectors 16 64943)
 (vector-slots 8 1166513 120164)
 (floats 8 455 292)
 (intervals 56 3980 450)
 (buffers 1000 18))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57676; Package emacs. (Thu, 08 Sep 2022 12:52:01 GMT) Full text and rfc822 format available.

Message #8 received at 57676 <at> debbugs.gnu.org (full text, mbox):

From: James Ferguson <james <at> faff.org>
To: 57676 <at> debbugs.gnu.org
Subject: further info
Date: Thu, 8 Sep 2022 08:50:45 -0400
[Message part 1 (text/plain, inline)]
I forgot to say, the way I'm spawning vterm is just effectively:

(let ((default-directory "sshx:<host>:.")) (vterm))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57676; Package emacs. (Thu, 08 Sep 2022 13:14:02 GMT) Full text and rfc822 format available.

Message #11 received at 57676 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: James Ferguson <james <at> faff.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 57676 <at> debbugs.gnu.org
Subject: Re: bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with
 remote default-directory
Date: Thu, 08 Sep 2022 15:13:32 +0200
James Ferguson <james <at> faff.org> writes:

> When trying to close the terminal one way or another (with debug-on-error) I now
> get:
>
> Debugger entered--Lisp error: (file-error "File ‘.’ must be absolute")
>   signal(file-error ("File ‘.’ must be absolute"))
>   tramp-error((tramp-file-name "sshx" nil nil "4x02" nil "." nil) file-error "File `%s'
> must be absolute" ".")
>   tramp-file-name-unify((tramp-file-name "sshx" nil nil "4x02" nil "." nil) ".")

I think this is the same as bug#57572 -- it's bugging out here:

	       ;; FIXME: This is a sanity check.  When this error
	       ;; doesn't happen for a while, it can be removed.
	       (or (file-name-absolute-p localname)
		   (tramp-error
		    vec 'file-error "File `%s' must be absolute" localname))

So I guess this sanity check should perhaps be removed?  Michael?




Forcibly Merged 57572 57676. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 08 Sep 2022 13:14:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57676; Package emacs. (Thu, 08 Sep 2022 15:21:01 GMT) Full text and rfc822 format available.

Message #16 received at 57676 <at> debbugs.gnu.org (full text, mbox):

From: James Ferguson <james <at> faff.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 57676 <at> debbugs.gnu.org
Subject: Re: bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with
 remote default-directory
Date: Thu, 8 Sep 2022 11:20:10 -0400
[Message part 1 (text/plain, inline)]
That's definitely what raises the error, though the comment implies to me
that it's unexpected/undesirable that it is triggered.

On Thu, Sep 8, 2022 at 9:13 AM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> James Ferguson <james <at> faff.org> writes:
>
> > When trying to close the terminal one way or another (with
> debug-on-error) I now
> > get:
> >
> > Debugger entered--Lisp error: (file-error "File ‘.’ must be absolute")
> >   signal(file-error ("File ‘.’ must be absolute"))
> >   tramp-error((tramp-file-name "sshx" nil nil "4x02" nil "." nil)
> file-error "File `%s'
> > must be absolute" ".")
> >   tramp-file-name-unify((tramp-file-name "sshx" nil nil "4x02" nil "."
> nil) ".")
>
> I think this is the same as bug#57572 -- it's bugging out here:
>
>                ;; FIXME: This is a sanity check.  When this error
>                ;; doesn't happen for a while, it can be removed.
>                (or (file-name-absolute-p localname)
>                    (tramp-error
>                     vec 'file-error "File `%s' must be absolute"
> localname))
>
> So I guess this sanity check should perhaps be removed?  Michael?
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57676; Package emacs. (Sat, 10 Sep 2022 11:50:02 GMT) Full text and rfc822 format available.

Message #19 received at 57676 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: James Ferguson <james <at> faff.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57676 <at> debbugs.gnu.org
Subject: Re: bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with
 remote default-directory
Date: Sat, 10 Sep 2022 13:48:56 +0200
James Ferguson <james <at> faff.org> writes:

Hi James,

> That's definitely what raises the error, though the comment implies to
> me that it's unexpected/undesirable that it is triggered.

Indeed. Your backtrace from the original report shows

> Debugger entered--Lisp error: (file-error "File ‘.’ must be absolute")
>   signal(file-error ("File ‘.’ must be absolute"))
>   tramp-error((tramp-file-name "sshx" nil nil "4x02" nil "." nil) file-error "File `%s' must be absolute" ".")
>   tramp-file-name-unify((tramp-file-name "sshx" nil nil "4x02" nil "." nil) ".")
>   tramp-get-file-property((tramp-file-name "sshx" nil nil "4x02" nil "." nil) "." "file-truename")
>   tramp-flush-file-properties((tramp-file-name "sshx" nil nil "4x02" nil "." nil) ".")
>   tramp-flush-file-function()
>   kill-buffer(#<buffer Terminal-4x02 volta <at> 4x02 (10.0.154.60) - byobu>)

We see, that `tramp-flush-file-properties' is called with
`default-directory' "." in #<buffer Terminal-4x02 volta <at> 4x02 (10.0.154.60) - byobu>

This is obviously an error, because the docstring of `default-directory'
says

--8<---------------cut here---------------start------------->8---
Name of default directory of current buffer.
It should be an absolute directory name; on GNU and Unix systems,
these names start with ‘/’ or ‘~’ and end with ‘/’.
--8<---------------cut here---------------end--------------->8---

Perhaps you could report this to the maintainer of vterm.

For the time being, I've pushed a fix to Emacs master which expands
`default-directory' inside `tramp-flush-file-properties'. Could you,
pls, check?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57676; Package emacs. (Sat, 10 Sep 2022 20:51:01 GMT) Full text and rfc822 format available.

Message #22 received at 57676 <at> debbugs.gnu.org (full text, mbox):

From: James Ferguson <james <at> faff.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57676 <at> debbugs.gnu.org
Subject: Re: bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with
 remote default-directory
Date: Sat, 10 Sep 2022 16:50:34 -0400
[Message part 1 (text/plain, inline)]
I can confirm the latest build no longer causes me that problem.

It's not vterm's fault, it's mine.  I set `default-directory` like that
when spawning it, which I have just been getting away with for a long
time.  It seems up until now a lot of things have been tolerant of my
invalid local path, with empty, '.' or './' seemingly being treated like
'~' before now.

So I'll be fixing my code that created a badly formed default-directory as
well.

Thank you for your efforts!  I'm very glad to see Tramp is getting some
attention.  I love it and rely on it but it adds a lot of latency for me
with its extensive round trips when establishing connections (I have to ssh
via an AWS jumphost).





On Sat, Sep 10, 2022 at 7:49 AM Michael Albinus <michael.albinus <at> gmx.de>
wrote:

> James Ferguson <james <at> faff.org> writes:
>
> Hi James,
>
> > That's definitely what raises the error, though the comment implies to
> > me that it's unexpected/undesirable that it is triggered.
>
> Indeed. Your backtrace from the original report shows
>
> > Debugger entered--Lisp error: (file-error "File ‘.’ must be absolute")
> >   signal(file-error ("File ‘.’ must be absolute"))
> >   tramp-error((tramp-file-name "sshx" nil nil "4x02" nil "." nil)
> file-error "File `%s' must be absolute" ".")
> >   tramp-file-name-unify((tramp-file-name "sshx" nil nil "4x02" nil "."
> nil) ".")
> >   tramp-get-file-property((tramp-file-name "sshx" nil nil "4x02" nil "."
> nil) "." "file-truename")
> >   tramp-flush-file-properties((tramp-file-name "sshx" nil nil "4x02" nil
> "." nil) ".")
> >   tramp-flush-file-function()
> >   kill-buffer(#<buffer Terminal-4x02 volta <at> 4x02 (10.0.154.60) - byobu>)
>
> We see, that `tramp-flush-file-properties' is called with
> `default-directory' "." in #<buffer Terminal-4x02 volta <at> 4x02
> (10.0.154.60) - byobu>
>
> This is obviously an error, because the docstring of `default-directory'
> says
>
> --8<---------------cut here---------------start------------->8---
> Name of default directory of current buffer.
> It should be an absolute directory name; on GNU and Unix systems,
> these names start with ‘/’ or ‘~’ and end with ‘/’.
> --8<---------------cut here---------------end--------------->8---
>
> Perhaps you could report this to the maintainer of vterm.
>
> For the time being, I've pushed a fix to Emacs master which expands
> `default-directory' inside `tramp-flush-file-properties'. Could you,
> pls, check?
>
> Best regards, Michael.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57676; Package emacs. (Sun, 11 Sep 2022 13:15:02 GMT) Full text and rfc822 format available.

Message #25 received at 57676 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: James Ferguson <james <at> faff.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57676 <at> debbugs.gnu.org
Subject: Re: bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with
 remote default-directory
Date: Sun, 11 Sep 2022 15:14:30 +0200
James Ferguson <james <at> faff.org> writes:

Hi James,

> I can confirm the latest build no longer causes me that problem.

Thanks for the feedback!

> It's not vterm's fault, it's mine.  I set `default-directory` like
> that when spawning it, which I have just been getting away with for a
> long time.  It seems up until now a lot of things have been tolerant
> of my invalid local path, with empty, '.' or './' seemingly being
> treated like '~' before now.
>
> So I'll be fixing my code that created a badly formed
> default-directory as well.

Good to know ther's no error in Tramp or vterm.

> Thank you for your efforts!  I'm very glad to see Tramp is getting
> some attention.  I love it and rely on it but it adds a lot of latency
> for me with its extensive round trips when establishing connections (I
> have to ssh via an AWS jumphost).

The Tramp FAQ has an item "How to speed up TRAMP?", see
(info "(tramp) Frequently Asked Questions")

Perhaps you could profit from the recommendations.

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 Oct 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 192 days ago.

Previous Next


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