unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory
@ 2022-09-08 12:48 James Ferguson
  2022-09-08 12:50 ` bug#57676: further info James Ferguson
  2022-09-08 13:13 ` bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: James Ferguson @ 2022-09-08 12:48 UTC (permalink / raw)
  To: 57676

[-- Attachment #1: Type: text/plain, Size: 9242 bytes --]

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@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))

[-- Attachment #2: Type: text/html, Size: 9970 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#57676: further info
  2022-09-08 12:48 bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory James Ferguson
@ 2022-09-08 12:50 ` James Ferguson
  2022-09-08 13:13 ` bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory Lars Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: James Ferguson @ 2022-09-08 12:50 UTC (permalink / raw)
  To: 57676

[-- Attachment #1: Type: text/plain, Size: 118 bytes --]

I forgot to say, the way I'm spawning vterm is just effectively:

(let ((default-directory "sshx:<host>:.")) (vterm))

[-- Attachment #2: Type: text/html, Size: 213 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory
  2022-09-08 12:48 bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory James Ferguson
  2022-09-08 12:50 ` bug#57676: further info James Ferguson
@ 2022-09-08 13:13 ` Lars Ingebrigtsen
  2022-09-08 15:20   ` James Ferguson
  1 sibling, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-08 13:13 UTC (permalink / raw)
  To: James Ferguson; +Cc: Michael Albinus, 57676

James Ferguson <james@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?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory
  2022-09-08 13:13 ` bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory Lars Ingebrigtsen
@ 2022-09-08 15:20   ` James Ferguson
  2022-09-10 11:48     ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: James Ferguson @ 2022-09-08 15:20 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Michael Albinus, 57676

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

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@gnus.org> wrote:

> James Ferguson <james@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?
>

[-- Attachment #2: Type: text/html, Size: 1765 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory
  2022-09-08 15:20   ` James Ferguson
@ 2022-09-10 11:48     ` Michael Albinus
  2022-09-10 20:50       ` James Ferguson
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2022-09-10 11:48 UTC (permalink / raw)
  To: James Ferguson; +Cc: Lars Ingebrigtsen, 57676

James Ferguson <james@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@4x02 (10.0.154.60) - byobu>)

We see, that `tramp-flush-file-properties' is called with
`default-directory' "." in #<buffer Terminal-4x02 volta@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory
  2022-09-10 11:48     ` Michael Albinus
@ 2022-09-10 20:50       ` James Ferguson
  2022-09-11 13:14         ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: James Ferguson @ 2022-09-10 20:50 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Lars Ingebrigtsen, 57676

[-- Attachment #1: Type: text/plain, Size: 2551 bytes --]

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@gmx.de>
wrote:

> James Ferguson <james@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@4x02 (10.0.154.60) - byobu>)
>
> We see, that `tramp-flush-file-properties' is called with
> `default-directory' "." in #<buffer Terminal-4x02 volta@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.
>

[-- Attachment #2: Type: text/html, Size: 3474 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory
  2022-09-10 20:50       ` James Ferguson
@ 2022-09-11 13:14         ` Michael Albinus
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2022-09-11 13:14 UTC (permalink / raw)
  To: James Ferguson; +Cc: Lars Ingebrigtsen, 57676

James Ferguson <james@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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-11 13:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08 12:48 bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory James Ferguson
2022-09-08 12:50 ` bug#57676: further info James Ferguson
2022-09-08 13:13 ` bug#57676: 29.0.50; Tramp: Unable to close vterm buffer with remote default-directory Lars Ingebrigtsen
2022-09-08 15:20   ` James Ferguson
2022-09-10 11:48     ` Michael Albinus
2022-09-10 20:50       ` James Ferguson
2022-09-11 13:14         ` Michael Albinus

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).