bug#34847: 27.0.50; auto-revert-buffers occasionally selects a killed buffer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#34847: 27.0.50; auto-revert-buffers occasionally selects a killed buffer

Dale Sedivec-6
Lately, while in the process of using Magit, I've frequently gotten
"Selecting deleting buffer" errors.  Here's a backtrace I got while
exiting magit-ediff:

~~~~~~
Debugger entered--Lisp error: (error "Selecting deleted buffer")
  set-buffer(#<killed buffer>)
  (save-current-buffer (set-buffer buf) (if (buffer-live-p buf) (progn
(if (and (not auto-revert-mode) (not auto-revert-tail-mode) (memq buf
auto-revert-buffer-list)) (auto-revert-remove-current-buffer)) (if
(auto-revert-active-p) (progn (if (and auto-revert-use-notify (not
auto-revert-notify-watch-descriptor)) (progn
(auto-revert-notify-add-watch))) (auto-revert-handler))))
(auto-revert-remove-current-buffer)))
  (let ((buf (car bufs))) (save-current-buffer (set-buffer buf) (if
(buffer-live-p buf) (progn (if (and (not auto-revert-mode) (not
auto-revert-tail-mode) (memq buf auto-revert-buffer-list))
(auto-revert-remove-current-buffer)) (if (auto-revert-active-p) (progn
(if (and auto-revert-use-notify ...) (progn ...))
(auto-revert-handler)))) (auto-revert-remove-current-buffer))))
  (while (and bufs (not (and auto-revert-stop-on-user-input
(input-pending-p)))) (let ((buf (car bufs))) (save-current-buffer
(set-buffer buf) (if (buffer-live-p buf) (progn (if (and (not
auto-revert-mode) (not auto-revert-tail-mode) (memq buf
auto-revert-buffer-list)) (auto-revert-remove-current-buffer)) (if
(auto-revert-active-p) (progn (if ... ...) (auto-revert-handler))))
(auto-revert-remove-current-buffer)))) (setq bufs (cdr bufs)))
  (let ((bufs (if global-auto-revert-mode (buffer-list)
auto-revert-buffer-list)) remaining new) (setq bufs (delq nil (mapcar
#'(lambda (buf) (save-current-buffer (set-buffer buf) (and ... buf)))
bufs))) (let ((--dolist-tail-- auto-revert-remaining-buffers)) (while
--dolist-tail-- (let ((buf (car --dolist-tail--))) (if (memq buf bufs)
(setq remaining (cons buf remaining))) (setq --dolist-tail-- (cdr
--dolist-tail--))))) (let ((--dolist-tail-- bufs)) (while
--dolist-tail-- (let ((buf (car --dolist-tail--))) (if (not (memq buf
remaining)) (setq new (cons buf new))) (setq --dolist-tail-- (cdr
--dolist-tail--))))) (setq bufs (nreverse (nconc new remaining)))
(while (and bufs (not (and auto-revert-stop-on-user-input
(input-pending-p)))) (let ((buf (car bufs))) (save-current-buffer
(set-buffer buf) (if (buffer-live-p buf) (progn (if (and ... ... ...)
(auto-revert-remove-current-buffer)) (if (auto-revert-active-p) (progn
... ...))) (auto-revert-remove-current-buffer)))) (setq bufs (cdr
bufs))) (setq auto-revert-remaining-buffers bufs) (if (and (not
global-auto-revert-mode) (null auto-revert-buffer-list)) (progn (if
(timerp auto-revert-timer) (cancel-timer auto-revert-timer)) (setq
auto-revert-timer nil))))
  (progn (let ((bufs (if global-auto-revert-mode (buffer-list)
auto-revert-buffer-list)) remaining new) (setq bufs (delq nil (mapcar
#'(lambda (buf) (save-current-buffer ... ...)) bufs))) (let
((--dolist-tail-- auto-revert-remaining-buffers)) (while
--dolist-tail-- (let ((buf (car --dolist-tail--))) (if (memq buf bufs)
(setq remaining (cons buf remaining))) (setq --dolist-tail-- (cdr
--dolist-tail--))))) (let ((--dolist-tail-- bufs)) (while
--dolist-tail-- (let ((buf (car --dolist-tail--))) (if (not (memq buf
remaining)) (setq new (cons buf new))) (setq --dolist-tail-- (cdr
--dolist-tail--))))) (setq bufs (nreverse (nconc new remaining)))
(while (and bufs (not (and auto-revert-stop-on-user-input
(input-pending-p)))) (let ((buf (car bufs))) (save-current-buffer
(set-buffer buf) (if (buffer-live-p buf) (progn (if ... ...) (if ...
...)) (auto-revert-remove-current-buffer)))) (setq bufs (cdr bufs)))
(setq auto-revert-remaining-buffers bufs) (if (and (not
global-auto-revert-mode) (null auto-revert-buffer-list)) (progn (if
(timerp auto-revert-timer) (cancel-timer auto-revert-timer)) (setq
auto-revert-timer nil)))))
  (unwind-protect (progn (let ((bufs (if global-auto-revert-mode
(buffer-list) auto-revert-buffer-list)) remaining new) (setq bufs
(delq nil (mapcar #'(lambda ... ...) bufs))) (let ((--dolist-tail--
auto-revert-remaining-buffers)) (while --dolist-tail-- (let ((buf
...)) (if (memq buf bufs) (setq remaining ...)) (setq --dolist-tail--
(cdr --dolist-tail--))))) (let ((--dolist-tail-- bufs)) (while
--dolist-tail-- (let ((buf ...)) (if (not ...) (setq new ...)) (setq
--dolist-tail-- (cdr --dolist-tail--))))) (setq bufs (nreverse (nconc
new remaining))) (while (and bufs (not (and
auto-revert-stop-on-user-input (input-pending-p)))) (let ((buf (car
bufs))) (save-current-buffer (set-buffer buf) (if (buffer-live-p buf)
(progn ... ...) (auto-revert-remove-current-buffer)))) (setq bufs (cdr
bufs))) (setq auto-revert-remaining-buffers bufs) (if (and (not
global-auto-revert-mode) (null auto-revert-buffer-list)) (progn (if
(timerp auto-revert-timer) (cancel-timer auto-revert-timer)) (setq
auto-revert-timer nil))))) (set-match-data save-match-data-internal
'evaporate))
  (let ((save-match-data-internal (match-data))) (unwind-protect
(progn (let ((bufs (if global-auto-revert-mode (buffer-list)
auto-revert-buffer-list)) remaining new) (setq bufs (delq nil (mapcar
#'... bufs))) (let ((--dolist-tail-- auto-revert-remaining-buffers))
(while --dolist-tail-- (let (...) (if ... ...) (setq --dolist-tail--
...)))) (let ((--dolist-tail-- bufs)) (while --dolist-tail-- (let
(...) (if ... ...) (setq --dolist-tail-- ...)))) (setq bufs (nreverse
(nconc new remaining))) (while (and bufs (not (and
auto-revert-stop-on-user-input ...))) (let ((buf ...))
(save-current-buffer (set-buffer buf) (if ... ... ...))) (setq bufs
(cdr bufs))) (setq auto-revert-remaining-buffers bufs) (if (and (not
global-auto-revert-mode) (null auto-revert-buffer-list)) (progn (if
(timerp auto-revert-timer) (cancel-timer auto-revert-timer)) (setq
auto-revert-timer nil))))) (set-match-data save-match-data-internal
'evaporate)))
  (closure (t) nil "Revert buffers as specified by Auto-Revert and
Glo..." (setq auto-revert-buffers-counter (1+
auto-revert-buffers-counter)) (let ((save-match-data-internal
(match-data))) (unwind-protect (progn (let ((bufs (if
global-auto-revert-mode ... auto-revert-buffer-list)) remaining new)
(setq bufs (delq nil (mapcar ... bufs))) (let ((--dolist-tail--
auto-revert-remaining-buffers)) (while --dolist-tail-- (let ... ...
...))) (let ((--dolist-tail-- bufs)) (while --dolist-tail-- (let ...
... ...))) (setq bufs (nreverse (nconc new remaining))) (while (and
bufs (not ...)) (let (...) (save-current-buffer ... ...)) (setq bufs
(cdr bufs))) (setq auto-revert-remaining-buffers bufs) (if (and (not
global-auto-revert-mode) (null auto-revert-buffer-list)) (progn (if
... ...) (setq auto-revert-timer nil))))) (set-match-data
save-match-data-internal 'evaporate))))()
  apply((closure (t) nil "Revert buffers as specified by Auto-Revert
and Glo..." (setq auto-revert-buffers-counter (1+
auto-revert-buffers-counter)) (let ((save-match-data-internal
(match-data))) (unwind-protect (progn (let ((bufs ...) remaining new)
(setq bufs (delq nil ...)) (let (...) (while --dolist-tail-- ...))
(let (...) (while --dolist-tail-- ...)) (setq bufs (nreverse ...))
(while (and bufs ...) (let ... ...) (setq bufs ...)) (setq
auto-revert-remaining-buffers bufs) (if (and ... ...) (progn ...
...)))) (set-match-data save-match-data-internal 'evaporate)))) nil)
  auto-revert-buffers()
  magit-auto-revert-buffers()
  magit-refresh()
  magit-update-index()
  (save-current-buffer (set-buffer ediff-buffer-B) (magit-update-index))
  (with-current-buffer ediff-buffer-B (magit-update-index))
  (and (buffer-live-p ediff-buffer-B) (buffer-modified-p
ediff-buffer-B) (with-current-buffer ediff-buffer-B
(magit-update-index)))
  (lambda nil (and (buffer-live-p ediff-buffer-B) (buffer-modified-p
ediff-buffer-B) (with-current-buffer ediff-buffer-B
(magit-update-index))) (and (buffer-live-p ediff-buffer-C)
(buffer-modified-p ediff-buffer-C) (with-current-buffer ediff-buffer-C
(when (y-or-n-p (format "Save file %s? " buffer-file-name))
(save-buffer)))) (ediff-kill-buffer-carefully ediff-buffer-A)
(ediff-kill-buffer-carefully ediff-buffer-B) (let
((magit-ediff-previous-winconf #<window-configuration>)) (run-hooks
'magit-ediff-quit-hook)))()
  run-hooks(ediff-quit-hook)
  ediff-really-quit(nil)
  ediff-quit(nil)
  funcall-interactively(ediff-quit nil)
  call-interactively(ediff-quit nil nil)
  command-execute(ediff-quit)
~~~~~~

I have global-auto-revert-mode on.  I *suspect* this happens because
*something* kills a buffer between when auto-revert-buffers collects
the list of buffers with (buffer-list) and when auto-revert-buffers
starts its final traversal of buffers in bufs (which starts out as
(buffer-list) in global-auto-revert-mode).

Around line 795 inside auto-revert-buffers, the code is:

          (with-current-buffer buf
            (if (buffer-live-p buf)
                ...
              ;; Remove dead buffer from `auto-revert-buffer-list'.
              (auto-revert-remove-current-buffer)))

It seems like reversing this so that with-current-buffer is only
called after buffer-live-p is checked might be a good solution to
avoid trying to select a deleted buffer?

Reproducing this is random for me but many times a day recently.
Alternatively, here is a contrived recipe to reproduce this error, but
*not* using global-auto-revert-mode, instead purposely putting a dead
buffer in auto-revert-buffer-list.  I think it still hits the same
code path inside auto-revert-buffers.

~~~~~~
(require 'autorevert)
(let ((buf (generate-new-buffer "foo")))
  (push buf auto-revert-buffer-list)
  (kill-buffer buf)
  (auto-revert-buffers))
~~~~~~

Regards,
Dale


In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.7.0, NS
appkit-1561.60 Version 10.13.6 (Build 17G5019))
 of 2019-03-12 built on dale
Repository revision: e2b261b66c8352fb07631a89de6c361fdb9e31b8
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1561
System Description:  Mac OS X 10.13.6

Recent messages:
[2019-03-13 12:43:09.484731]  [2 times]
[2019-03-13 12:43:12.296602] Mark set [2 times]
[2019-03-13 12:43:13.170098] Saved text until " nil nil)
  command-execute(ediff-quit)
"
[2019-03-13 12:43:17.822853] Continuing.
imenu-unavailable-error: Selecting deleted buffer
[2019-03-13 12:43:19.929933] Quit this Ediff session? (y or n) y
[2019-03-13 12:43:30.317398]  [2 times]
[2019-03-13 12:43:30.318205] ‘report-emacs-bug-info’ is an obsolete
command (as of 24.3); use ‘info-emacs-bug’ instead.

Configured using:
 'configure --with-ns --with-modules --with-rsvg --with-imagemagick
 --with-xml2 --with-gnutls --with-json --without-x'

Configured features:
RSVG IMAGEMAGICK GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS XIM NS MODULES THREADS JSON PDUMPER LCMS2

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

Major mode: Magit

Minor modes in effect:
  global-magit-file-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  which-function-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  winum-mode: t
  winner-mode: t
  imenu-list-minor-mode: t
  purpose-mode: t
  volatile-highlights-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  company-statistics-mode: t
  show-paren-mode: t
  sticky-region-mode: t
  save-place-mode: t
  recentf-mode: t
  counsel-projectile-mode: t
  projectile-mode: t
  persp-mode: t
  shell-dirtrack-mode: t
  minions-mode: t
  global-hl-todo-mode: t
  global-hi-lock-mode: t
  hi-lock-mode: t
  flycheck-pos-tip-mode: t
  global-flycheck-mode: t
  auto-frame-resize-mode: t
  global-edit-server-edit-mode: t
  dtrt-indent-global-mode: t
  global-diff-hl-mode: t
  counsel-mode: t
  ivy-mode: t
  delete-selection-mode: t
  clean-aindent-mode: t
  carousel-mode: t
  global-auto-revert-mode: t
  el-patch-use-package-mode: t
  which-key-mode: t
  override-global-mode: t
  auto-compile-on-load-mode: t
  auto-compile-on-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/Users/dale/.emacs.d/lisp/info-xref hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/info-xref
/Users/dale/.emacs.d/elpa/python-20181115.1504/python hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/progmodes/python
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-stan hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-stan
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-exp hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-exp
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-J hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-J
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-eshell hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-eshell
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-emacs-lisp
hides /Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-emacs-lisp
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-gnus hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-gnus
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-css hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-css
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-lob hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-lob
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-forth hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-forth
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-macs hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-macs
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-version hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-version
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-scheme hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-scheme
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-abc hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-abc
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-C hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-C
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-capture hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-capture
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-ref hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ref
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-clojure hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-clojure
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-mouse hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-mouse
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-ledger hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ledger
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-ctags hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-ctags
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-entities hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-entities
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-archive hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-archive
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-screen hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-screen
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-haskell hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-haskell
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-asymptote hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-asymptote
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-mhe hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-mhe
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-table hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-table
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-org hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-org
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-plot hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-plot
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-awk hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-awk
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-groovy hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-groovy
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-octave hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-octave
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-faces hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-faces
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-colview hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-colview
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-R hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-R
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-timer hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-timer
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-ebnf hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ebnf
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-mobile hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-mobile
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-fortran hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-fortran
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-shell hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-shell
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-perl hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-perl
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-sqlite hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-sqlite
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-sed hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-sed
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-list hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-list
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-ruby hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ruby
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-eval hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-eval
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-habit hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-habit
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-clock hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-clock
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-html hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-html
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-src hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-src
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-lisp hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-lisp
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-ditaa hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ditaa
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-pcomplete
hides /Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-pcomplete
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-lint hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-lint
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-rmail hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-rmail
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-latex hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-latex
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-sass hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-sass
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-io hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-io
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-tangle hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-tangle
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-calc hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-calc
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-java hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-java
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-icalendar hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-icalendar
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-eww hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-eww
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-md hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-md
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-beamer hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-beamer
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-element hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-element
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-protocol hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-protocol
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-mscgen hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-mscgen
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-gnuplot hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-gnuplot
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-latex hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-latex
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-id hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-id
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-vala hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-vala
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-man hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-man
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-feed hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-feed
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-lua hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-lua
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-table hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-table
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-ocaml hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-ocaml
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-coq hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-coq
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-picolisp hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-picolisp
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-indent hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-indent
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-lilypond hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-lilypond
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-matlab hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-matlab
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-datetree hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-datetree
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-python hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-python
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-bbdb hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-bbdb
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-makefile hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-makefile
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-duration hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-duration
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-agenda hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-agenda
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-dot hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-dot
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-js hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-js
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-publish hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-publish
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-inlinetask
hides /Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-inlinetask
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-org hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-org
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-core hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-core
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-compat hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-compat
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-docview hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-docview
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-odt hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-odt
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-plantuml hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-plantuml
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-ascii hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-ascii
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-loaddefs hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-loaddefs
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-w3m hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-w3m
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-bibtex hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-bibtex
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-info hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-info
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-hledger hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-hledger
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-maxima hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-maxima
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-macro hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-macro
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-sql hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-sql
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-attach hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-attach
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-processing
hides /Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-processing
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ox-texinfo hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ox-texinfo
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-irc hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-irc
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-crypt hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-crypt
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-footnote hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-footnote
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/org-install hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/org-install
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-comint hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-comint
/Users/dale/.emacs.d/elpa/org-plus-contrib-20190306/ob-shen hides
/Users/dale/Applications/Emacs.app/Contents/Resources/lisp/org/ob-shen

Features:
(shadow sort mail-extr emacsbug sendmail two-column iso-transl dired-aux
counsel-advice-remove ace-window disp-table conf-mode comment-dwim-2
warnings macrostep ivy-xref counsel-auto-grep disass vc-annotate
pkg-info epl pyvenv esh-var esh-cmd esh-opt esh-io esh-ext esh-proc
esh-arg esh-groups eshell esh-module esh-mode esh-util mc-mark-more
multiple-cursors-core rect hl-line+ hl-line hideshow company-anaconda
face-remap markdown-mode edit-indirect deft pulse misearch multi-isearch
debug backtrace link-hint browse-url avy bs magit-imenu git-rebase
magit-ediff ediff-merg ediff-wind ediff-diff ediff-mult ediff-help
ediff-init ediff-util ediff unfill bug-reference adaptive-wrap
magit-extras magit-bookmark magit-submodule magit-obsolete magit-blame
magit-stash 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 magit-core magit-autorevert magit-margin
magit-transient magit-process magit-mode transient git-commit magit-git
magit-section magit-utils crm log-edit pcvs-util with-editor
async-bytecomp async eieio-opt speedbar sb-image ezimage dframe
cl-indent mwim cl-print ielm amx url-cache url-http url-gw url-auth
add-log frameset org-duration org-table org-eldoc org-indent eltu
anaconda-mode url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap pythonic
network-stream nsm importmagic f s epc ctable concurrent deferred
python-el-fgallina-expansions python tramp-sh tramp tramp-loaddefs
trampver tramp-integration tramp-compat which-func persistent-soft
list-utils pcache eieio-base font-utils haskell-snippets
yasnippet-snippets yasnippet winum winner window-purpose-x imenu-list
ivy-switch-with-purpose window-purpose window-purpose-fixes
window-purpose-prefix-overload window-purpose-switch let-alist
window-purpose-layout window-purpose-core window-purpose-configuration
eieio-compat window-purpose-utils windmove volatile-highlights
all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons memoize
unicode-fonts undo-tree diff paredit aggressive-indent rainbow-mode
whitespace wspc-hydra auto-highlight-symbol company-keywords
company-etags etags fileloop company-gtags company-template
company-dabbrev-code company-dabbrev company-files company-capf
company-statistics company-tng company flyspell ispell goto-addr
highlight-parentheses paren sticky-region server saveplace reformatter
recentf tree-widget counsel-projectile projectile grep ibuf-ext ibuffer
ibuffer-loaddefs persp-mode org-clock ob-shell shell ob-sql ob-python
org-eww org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source
utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range message rmc
puny rfc822 mml mml-sec epa epg mailabbrev gmm-utils mailheader gnus-win
gnus nnheader gnus-util rmail rmail-loaddefs mail-utils org-docview
doc-view image-mode org-bibtex bibtex org-bbdb org-w3m org-id org-tempo
tempo cus-edit cus-start cus-load wid-edit org-element avl-tree
generator the-org-mode-expansions org-inset-dblock org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete pcomplete org-list org-faces org-entities time-date
noutline outline org-version ob-emacs-lisp ob-core ob-eval org-keys
org-compat org-macs org-loaddefs format-spec cal-menu calendar
cal-loaddefs move-text minions smart-tabs lisp-comment-dwim hydra lv
hl-todo hi-lock flycheck-pos-tip pos-tip flycheck-package package-lint
imenu finder flycheck frame-resize expand-region text-mode-expansions
er-basic-expansions expand-region-core expand-region-custom edit-server
dtrt-indent diff-hl vc-dir ewoc vc vc-dispatcher counsel xdg xref
project compile comint ansi-color ring swiper ivy flx delsel colir color
ivy-overlay ffap thingatpt clean-aindent-mode carousel bookmark+
bookmark+-key derived dired-x dired dired-loaddefs bookmark+-1
bookmark+-bmu bookmark+-lit bookmark pp autorevert filenotify vc-git
diff-mode elec-pair find-func el-patch exec-path-from-shell which-key
advice paranoid-locals files-x cl-extra bind-key easy-mmode pcase dash
treepy quelpa mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr lisp-mnt help-fns radix-tree
help-mode jka-compr auto-compile packed finder-inf dsedivec-theme
autoloads tex-site edmacro kmacro rx sly-autoloads cl info package
easymenu epg-config 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
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame 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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 1534501 263419)
 (symbols 48 54953 55)
 (strings 32 286959 26451)
 (string-bytes 1 8874219)
 (vectors 16 181513)
 (vector-slots 8 4860347 194852)
 (floats 8 1033 1217)
 (intervals 56 125404 6360)
 (buffers 992 151))



Reply | Threaded
Open this post in threaded view
|

bug#34847: 27.0.50; auto-revert-buffers occasionally selects a killed buffer

Michael Albinus
Dale Sedivec <[hidden email]> writes:

Hi Dale,

Thanks for the report.

> Lately, while in the process of using Magit, I've frequently gotten
> "Selecting deleting buffer" errors.
>
> I have global-auto-revert-mode on.  I *suspect* this happens because
> *something* kills a buffer between when auto-revert-buffers collects
> the list of buffers with (buffer-list) and when auto-revert-buffers
> starts its final traversal of buffers in bufs (which starts out as
> (buffer-list) in global-auto-revert-mode).
>
> Around line 795 inside auto-revert-buffers, the code is:
>
>           (with-current-buffer buf
>             (if (buffer-live-p buf)
>                 ...
>               ;; Remove dead buffer from `auto-revert-buffer-list'.
>               (auto-revert-remove-current-buffer)))
>
> It seems like reversing this so that with-current-buffer is only
> called after buffer-live-p is checked might be a good solution to
> avoid trying to select a deleted buffer?
Something like this. But the final `auto-revert-remove-current-buffer'
needs the buffer to be removed as the current one. So it is a bit more
complex.

I came up with the following patch:


*** /tmp/ediffWnT0dx 2019-03-24 15:30:02.022068542 +0100
--- /home/albinus/src/emacs/lisp/autorevert.el 2019-03-24 15:26:41.756960378 +0100
***************
*** 343,352 ****

  ;; Functions:

! (defun auto-revert-remove-current-buffer ()
    "Remove dead buffer from `auto-revert-buffer-list'."
    (setq auto-revert-buffer-list
!         (delq (current-buffer) auto-revert-buffer-list)))

  ;;;###autoload
  (define-minor-mode auto-revert-mode
--- 343,352 ----

  ;; Functions:

! (defun auto-revert-remove-current-buffer (&optional buffer)
    "Remove dead buffer from `auto-revert-buffer-list'."
    (setq auto-revert-buffer-list
!         (delq (or buffer (current-buffer)) auto-revert-buffer-list)))

  ;;;###autoload
  (define-minor-mode auto-revert-mode
***************
*** 772,781 ****
        (setq bufs (delq nil
                         (mapcar
                          (lambda (buf)
!                           (with-current-buffer buf
!                             (and (or (not (file-remote-p default-directory))
!                                      (file-remote-p default-directory nil t))
!                                  buf)))
                          bufs)))
        ;; Partition `bufs' into two halves depending on whether or not
        ;; the buffers are in `auto-revert-remaining-buffers'.  The two
--- 772,783 ----
        (setq bufs (delq nil
                         (mapcar
                          (lambda (buf)
!                           (and (buffer-live-p buf)
!                                (with-current-buffer buf
!                                  (and
!                                   (or (not (file-remote-p default-directory))
!                                       (file-remote-p default-directory nil t))
!                                       buf))))
                          bufs)))
        ;; Partition `bufs' into two halves depending on whether or not
        ;; the buffers are in `auto-revert-remaining-buffers'.  The two
***************
*** 792,815 ****
   (not (and auto-revert-stop-on-user-input
     (input-pending-p))))
  (let ((buf (car bufs)))
!           (with-current-buffer buf
!             (if (buffer-live-p buf)
!                 (progn
!                   ;; Test if someone has turned off Auto-Revert Mode
!                   ;; in a non-standard way, for example by changing
!                   ;; major mode.
!                   (if (and (not auto-revert-mode)
!                            (not auto-revert-tail-mode)
!                            (memq buf auto-revert-buffer-list))
!                       (auto-revert-remove-current-buffer))
!                   (when (auto-revert-active-p)
!                     ;; Enable file notification.
!                     (when (and auto-revert-use-notify
!                                (not auto-revert-notify-watch-descriptor))
!                       (auto-revert-notify-add-watch))
!                     (auto-revert-handler)))
                ;; Remove dead buffer from `auto-revert-buffer-list'.
!               (auto-revert-remove-current-buffer))))
  (setq bufs (cdr bufs)))
        (setq auto-revert-remaining-buffers bufs)
        ;; Check if we should cancel the timer.
--- 794,816 ----
   (not (and auto-revert-stop-on-user-input
     (input-pending-p))))
  (let ((buf (car bufs)))
!           (if (not (buffer-live-p buf))
                ;; Remove dead buffer from `auto-revert-buffer-list'.
!               (auto-revert-remove-current-buffer buf)
!             (with-current-buffer buf
!               ;; Test if someone has turned off Auto-Revert Mode
!               ;; in a non-standard way, for example by changing
!               ;; major mode.
!               (if (and (not auto-revert-mode)
!                        (not auto-revert-tail-mode)
!                        (memq buf auto-revert-buffer-list))
!                   (auto-revert-remove-current-buffer))
!               (when (auto-revert-active-p)
!                 ;; Enable file notification.
!                 (when (and auto-revert-use-notify
!                            (not auto-revert-notify-watch-descriptor))
!                   (auto-revert-notify-add-watch))
!                 (auto-revert-handler)))))
  (setq bufs (cdr bufs)))
        (setq auto-revert-remaining-buffers bufs)
        ;; Check if we should cancel the timer.


> Reproducing this is random for me but many times a day recently.
> Alternatively, here is a contrived recipe to reproduce this error, but
> *not* using global-auto-revert-mode, instead purposely putting a dead
> buffer in auto-revert-buffer-list.  I think it still hits the same
> code path inside auto-revert-buffers.
>
> ~~~~~~
> (require 'autorevert)
> (let ((buf (generate-new-buffer "foo")))
>   (push buf auto-revert-buffer-list)
>   (kill-buffer buf)
>   (auto-revert-buffers))
This recipe fails earlier, in the lambda form checking remote buffers.
I've fixed this case as well.

Could you pls check whether the patch works for you with magit? (I
don't use magit myself)

> Regards,
> Dale

Best regards, Michael.