all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#49954: 28.0.50; TRAMP: cannot kill child processes: "Forbidden reentrant call of Tramp"
@ 2021-08-09  9:08 Dima Kogan
  2021-08-09 12:33 ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Dima Kogan @ 2021-08-09  9:08 UTC (permalink / raw)
  To: 49954

Hi. I see this problem often in everyday use of emacs, but every time I
try to construct a reliable reproducing recipe, it always works ok, so
some of this report is a request for debugging help.

I've seen this sort of bug for years, so probably it exists in the
latest emacs. Today I'm seeing it in a build from a few weeks ago:
553ad9c9e85 built on 20210716. I don't know how to reproduce in the
latest emacs. In the session I have running (from the 20210716 build) I
have a shell buffer that shows the problem 100% of the time. New shell
buffers do not show this problem.

A recipe that should work:

1. emacs
   Run emacs. Possibly my config is triggering it. I don't know

2. C-x C-f /ssh:server:
   Open a remote TRAMP connection

3. M-x shell
   Open a remote shell

4. cat
   Run a "cat" command in the remote shell

5. C-c C-c
   kill the "cat"

In fresh emacs sessions and fresh shell buffers this works fine: the
"cat" process is killed and we get back to the prompt. Something happens
with older shell buffers where the child process is NOT killed, and
emacs complains with "Forbidden reentrant call of Tramp"

I just tried to (setq tramp-verbose 10) to get a debug log of the
failure. It says this:

  ;; Emacs: 28.0.50 Tramp: 2.5.1 -*- mode: outline; coding: utf-8; -*-
  ;; Location: /usr/share/emacs/28.0.50/lisp/net/tramp.el.gz Git: /
  01:49:39.391745 tramp-interrupt-process (5) # Interrupt process shell<6> with pid 3705628
  01:49:39.391864 tramp-get-connection-property (7) # null-device /dev/null; cache used: t
  01:49:39.391946 tramp-get-connection-property (7) # process-name nil; cache used: nil
  01:49:39.392019 tramp-get-connection-property (7) # process-name nil; cache used: nil
  01:49:39.392089 tramp-get-connection-property (7) # process-buffer nil; cache used: nil
  01:49:39.392180 tramp-get-connection-property (7) # last-cmd-time (24848 60388 520023 896000); cache used: t
  01:49:39.392262 tramp-get-connection-property (7) # process-name nil; cache used: nil
  01:49:39.392325 tramp-get-connection-property (7) # remote-echo nil; cache used: nil
  01:49:39.392385 tramp-send-command (6) # echo are you awake
  01:49:39.392447 tramp-get-connection-property (7) # process-name nil; cache used: nil
  01:49:39.392509 tramp-get-connection-property (7) # chunksize 0; cache used: t
  01:49:39.392573 tramp-set-connection-property (7) # last-cmd-time (24848 60451 392543 712000)
  01:49:39.392637 tramp-send-string (10) # echo are you awake
  01:49:39.392698 tramp-get-connection-property (7) # process-buffer nil; cache used: nil
  01:49:39.392775 tramp-get-connection-property (7) # locked nil; cache used: nil
  01:49:39.392828 tramp-set-connection-property (7) # locked t
  01:49:39.392912 tramp-flush-connection-property (7) # locked
  01:49:39.392981 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
  01:49:39.393036 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
  01:49:39.393120 tramp-get-connection-property (7) # locked nil; cache used: nil
  01:49:39.393173 tramp-set-connection-property (7) # locked t
  01:49:39.441305 tramp-accept-process-output (10) # *tramp/ssh fatty* nil run t
  are you awake
  ///66c246702753a7fa497f74164e69b140#$
  01:49:39.441619 tramp-flush-connection-property (7) # locked
  01:49:39.441783 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
  01:49:39.441931 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
  01:49:39.442103 tramp-wait-for-regexp (6) # 
  are you awake
  ///66c246702753a7fa497f74164e69b140#$
  01:49:39.442387 tramp-get-connection-property (7) # process-name nil; cache used: nil
  01:49:39.442556 tramp-get-connection-property (7) # remote-echo nil; cache used: nil
  01:49:39.442710 tramp-send-command (6) # (\kill -2 -3705628 || \kill -2 3705628) 2>/dev/null
  01:49:39.442872 tramp-get-connection-property (7) # process-name nil; cache used: nil
  01:49:39.443034 tramp-get-connection-property (7) # chunksize 0; cache used: t
  01:49:39.443204 tramp-set-connection-property (7) # last-cmd-time (24848 60451 443130 172000)
  01:49:39.443376 tramp-send-string (10) # (\kill -2 -3705628 || \kill -2 3705628) 2>/dev/null
  01:49:39.443589 tramp-get-connection-property (7) # process-buffer nil; cache used: nil
  01:49:39.443792 tramp-get-connection-property (7) # locked nil; cache used: nil
  01:49:39.443936 tramp-set-connection-property (7) # locked t
  01:49:39.444124 tramp-flush-connection-property (7) # locked
  01:49:39.444293 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
  01:49:39.444433 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
  01:49:39.444579 tramp-get-connection-property (7) # locked nil; cache used: nil
  01:49:39.444719 tramp-set-connection-property (7) # locked t
  01:49:39.493255 tramp-accept-process-output (10) # *tramp/ssh fatty* nil run t
  ///66c246702753a7fa497f74164e69b140#$
  01:49:39.493535 tramp-flush-connection-property (7) # locked
  01:49:39.493687 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
  01:49:39.493835 tramp-get-connection-property (7) # check-remote-echo nil; cache used: nil
  01:49:39.494001 tramp-wait-for-regexp (6) # 
  ///66c246702753a7fa497f74164e69b140#$
  01:49:39.494263 tramp-get-connection-property (7) # locked t; cache used: t
  01:49:39.512596 tramp-accept-process-output (10) # 
    backtrace()
    tramp-error(#<process shell<6>> remote-file-error "Forbidden reentrant call of Tramp")
    tramp-accept-process-output(#<process shell<6>> 0)
    tramp-interrupt-process(nil t)
    comint-interrupt-subjob()
    funcall-interactively(comint-interrupt-subjob)
    command-execute(comint-interrupt-subjob)
  01:49:41.733242 tramp-accept-process-output


If I open a fresh shell in the same emacs session, it works OK. That
debug log is similar, except the last tramp-get-connection-property line says:

  01:48:36.571873 tramp-get-connection-property (7) # locked nil; cache used: nil

I don't know how it's unlocked. Debugging suggestions? Should I just add
more diagnostics in every lock/unlock path? Do we think this may be
fixed in the latest emacs?

Thanks!





^ permalink raw reply	[flat|nested] 19+ messages in thread
* bug#60534: 28.2; Forbidden reentrant call of Tramp
@ 2023-01-03 20:52 Georgi Danov
  2023-02-17  9:42 ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Georgi Danov @ 2023-01-03 20:52 UTC (permalink / raw)
  To: 60534; +Cc: michael.albinus


As discussed in github issue
https://github.com/joaotavora/eglot/issues/859# eglot over tramp throws
"reentrant call" error. This is sympthom of underlying design issue -
 aux libraries use files without being aware of the tramp conection, the
 connection itself has no concurrency control, pooling or other
 multi-user features and without that guard error different tramp clients
 corrupt each other's communication with the language server.

The problem is reproducible by using company mode, probably the language
is not important. In my case it's typescript. Takes 15-30 seconds of
editing and autocomplete to trigger it.

The main congestions seems to happen in file-truename() -- after
displaying candidate company mode goes on to do refresh in the background
and calls file-truename repeatedly while eglot (or someone else) is occupying the tramp
connection. Point is -- the same tramp connection is used by eglot and
any other minor mode that queries file name or state, but they have no
means to share or coordinate this use other than the exception above.

Tramp used to throw more insignificant error in the past and tolerate
the behavior (which corrupts the data exchanged between eglot and the
lsp) and now throws this error. See `with-tramp-locked-connection`
macro. 

I got this problem with other minor modes too, but did not capture the
stack as I lowered the error prio via (add-to-list 'debug-ignored-errors
'remote-file-error). Reading the code would've suggested corruption
won't happen but still garbage was let in the stdio pipe and eglot lost track of the
buffer state.

--------------------------
In GNU Emacs 28.2 (build 1, x86_64-apple-darwin22.1.0, Carbon Version 169 AppKit 2299)
 of 2022-11-24 built on GDMBP.local
Windowing system distributor 'Apple Inc.', version 13.1.0
System Description:  macOS 13.1

Configured using:
 'configure --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs-mac/emacs-28.2-mac-9.1/share/info/emacs
 --prefix=/usr/local/Cellar/emacs-mac/emacs-28.2-mac-9.1 --with-mac
 --enable-mac-app=/usr/local/Cellar/emacs-mac/emacs-28.2-mac-9.1
 --with-gnutls --with-modules'

Configured features:
ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE PDUMPER THREADS
TOOLKIT_SCROLL_BARS XIM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: TSX

Minor modes in effect:
  rainbow-delimiters-mode: t
  electric-pair-mode: t
  guru-mode: t
  subword-mode: t
  eglot--managed-mode: t
  flymake-mode: t
  popper-echo-mode: t
  popper-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  joro-mode: t
  doom-modeline-mode: t
  minions-mode: t
  override-global-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  global-hl-todo-mode: t
  hl-todo-mode: t
  which-function-mode: t
  global-company-mode: t
  company-mode: t
  helm-mode: t
  helm-minibuffer-history-mode: t
  helm-descbinds-mode: t
  helm--remap-mouse-mode: t
  async-bytecomp-package-mode: t
  ivy-mode: t
  editorconfig-mode: t
  winner-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-anzu-mode: t
  anzu-mode: t
  projectile-mode: t
  volatile-highlights-mode: t
  global-hl-line-mode: t
  super-save-mode: t
  windmove-mode: t
  recentf-mode: t
  savehist-mode: t
  save-place-mode: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  smartparens-mode: t
  global-auto-revert-mode: t
  delete-selection-mode: t
  prelude-mode: t
  shell-dirtrack-mode: t
  which-key-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mac-mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
/Users/gdanov/.emacs.d/elpa/cmake-mode-20221130.1357/cmake-mode hides /usr/local/share/emacs/site-lisp/cmake/cmake-mode
/Users/gdanov/.emacs.d/elpa/transient-20221119.1503/transient hides /usr/local/Cellar/emacs-mac/emacs-28.2-mac-9.1/share/emacs/28.2/lisp/transient

Features:
(shadow sort mail-extr emacsbug sendmail typescript-mode
cc-mode-expansions smartparens-c cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs eieio-opt speedbar
ezimage dframe helm-command bug-reference helm-x-files elisp-slime-nav
rainbow-delimiters elec-pair guru-mode subword-mode-expansions cap-words
superword subword eglot array jsonrpc ert debug flymake-proc flymake
ffap tramp-archive tramp-gvfs dbus helm-for-files helm-bookmark
helm-adaptive helm-external helm-net codespaces
use-package-ensure-system-package system-packages use-package
use-package-delight use-package-diminish tramp-theme em-dirs esh-var
esh-mode poly-markdown smartparens-markdown markdown-mode polymode
poly-lock polymode-base polymode-weave polymode-export polymode-compat
polymode-methods polymode-core polymode-classes eieio-custom eieio-base
graphql-mode let-alist org-jira org-jira-sdk jiralib request soap-client
url-http url-auth url-gw nsm rng-xsd xsd-regexp xml org-clock
the-org-mode-expansions org-element avl-tree smartparens-org org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src
ob-comint org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol
org-keys oc org-compat org-macs org-loaddefs cal-menu calendar
cal-loaddefs git-link popper-echo popper magit-bookmark magit-submodule
magit-obsolete magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode
git-commit log-edit message rmc puny rfc822 mml mml-sec epa epg rfc6068
epg-config gnus-util rmail rmail-loaddefs mailabbrev mail-utils
gmm-utils mailheader add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor server magit-mode transient
magit-git magit-base magit-section crm compat-27 compat-26 prettier-js
web-mode-expansions web-mode disp-table smart-shift indent-tools
yafolding hydra lv indent-tools-indentation-of highlight-indentation
helm-cider-history helm-cider helm-cider-spec helm-cider-repl
helm-cider-cheatsheet helm-cider-util cider-cheatsheet cider cider-debug
cider-browse-ns cider-mode cider-find cider-inspector cider-completion
cider-profile cider-eval cider-jar arc-mode archive-mode
cider-repl-history pulse cider-repl cider-resolve cider-test
cider-overlays cider-stacktrace cider-doc cider-browse-spec
cider-clojuredocs cider-eldoc cider-client cider-common cider-connection
cider-util cider-popup sesman-browser nrepl-client nrepl-dict spinner
clojure-mode-expansions smartparens-clojure sesman clojure-mode align
parseedn parseclj-parser parseclj-lex parseclj-alist posframe
doom-modeline doom-modeline-segments doom-modeline-env
doom-modeline-core all-the-icons all-the-icons-faces data-material
data-weathericons data-octicons data-fileicons data-faicons
data-alltheicons shrink-path f f-shortdoc shortdoc s minions
doom-themes-ext-org doom-themes-ext-treemacs doom-themes-ext-neotree
doom-themes-ext-visual-bell face-remap doom-one-theme doom-themes
doom-themes-base nlinum linum helm-ring helm-ls-git derived vc-git
helm-ag helm-xref use-package-bind-key bind-key rainbow-mode
quelpa-use-package quelpa mm-decode mm-bodies mm-encode help-fns
radix-tree use-package-ensure use-package-core prelude-modules
prelude-xml nxml-mode-expansions rng-nxml rng-valid rng-loc rng-uri
rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
nxml-mode nxml-outln nxml-rap html-mode-expansions smartparens-html
sgml-mode facemenu dom nxml-util nxml-enc xmltok prelude-shell sh-script
smie executable prelude-emacs-lisp prelude-lisp prelude-programming
flycheck hl-todo compat compat-macs which-func prelude-css
prelude-company company-oddmuse company-keywords company-etags
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb company prelude-helm-everywhere helm-mode
helm-misc helm-descbinds helm-eshell helm-elisp helm-eval edebug
backtrace find-func helm-info prelude-helm helm-projectile helm-files
image-dired image-mode exif helm-tags helm-buffers helm-occur helm-grep
helm-regexp helm-locate helm-types helm-imenu helm-utils helm-help helm
helm-global-bindings helm-easymenu helm-core async-bytecomp helm-source
helm-multi-match helm-lib async helm-config prelude-ivy two-column ivy
ivy-faces ivy-overlay colir color prelude-macos exec-path-from-shell
prelude-global-keybindings warnings prelude-editor editorconfig
editorconfig-core editorconfig-core-handle editorconfig-fnmatch
operate-on-number calc-bin calc-ext calc calc-loaddefs calc-macs diff-hl
smartrep log-view pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode
winner undo-tree diff queue eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util re-builder whitespace
tabify browse-kill-ring midnight ediff ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util dired-x anzu avy tramp-sh
projectile skeleton ibuf-macs find-dired dired dired-loaddefs lisp-mnt
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr grep
compile ibuf-ext ibuffer ibuffer-loaddefs bookmark text-property-search
pp expand-region text-mode-expansions er-basic-expansions
expand-region-core expand-region-custom flyspell ispell rect etags
fileloop generator xref project volatile-highlights hl-line super-save
windmove recentf tree-widget wid-edit savehist saveplace diminish
smartparens-config smartparens-text smartparens advice dash autorevert
filenotify delsel prelude-mode easy-mmode crux docker-tramp tramp-cache
tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat
shell pcomplete comint ansi-color ring parse-time iso8601 time-date
ls-lisp format-spec thingatpt imenu-anywhere imenu pcase jka-compr
prelude-core epl prelude-ui which-key prelude-custom prelude-packages
cl-extra help-mode finder-inf rx info edmacro kmacro package browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/mac-win mac-win term/common-win
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 cl-generic
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 simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads kqueue mac
multi-tty make-network-process emacs)

Memory information:
((conses 16 1024998 582937)
 (symbols 48 64969 19)
 (strings 32 287822 163197)
 (string-bytes 1 9937920)
 (vectors 16 113430)
 (vector-slots 8 2200185 552812)
 (floats 8 1234 2058)
 (intervals 56 14261 3055)
 (buffers 992 43))






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

end of thread, other threads:[~2024-12-17 13:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-09  9:08 bug#49954: 28.0.50; TRAMP: cannot kill child processes: "Forbidden reentrant call of Tramp" Dima Kogan
2021-08-09 12:33 ` Michael Albinus
2021-08-10  4:26   ` Dima Kogan
2021-08-10 13:52     ` Michael Albinus
2021-09-11  8:32       ` Dima Kogan
2021-09-11 12:19         ` Michael Albinus
2021-09-15  0:39           ` Dima Kogan
2021-09-15 19:25             ` Dima Kogan
2021-09-16 15:45               ` Michael Albinus
2021-09-16 15:42             ` Michael Albinus
2021-09-16 17:17               ` Dima Kogan
2021-09-16 17:36                 ` Michael Albinus
2021-09-18 20:18                   ` Dima Kogan
2021-09-18 20:50                     ` Michael Albinus
2024-12-16 22:35           ` bug#49954: bug#60534: 28.2; Forbidden reentrant call of Tramp James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-17  8:29             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-17 13:11               ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  -- strict thread matches above, loose matches on Subject: below --
2023-01-03 20:52 Georgi Danov
2023-02-17  9:42 ` Michael Albinus

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.