GNU bug report logs -
#34847
27.0.50; auto-revert-buffers occasionally selects a killed buffer
Previous Next
Reported by: Dale Sedivec <dale <at> codefu.org>
Date: Wed, 13 Mar 2019 18:09:01 UTC
Severity: normal
Tags: fixed, patch
Merged with 35755
Found in version 27.0.50
Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Dale Sedivec <dale <at> codefu.org> writes:
> Lately, while in the process of using Magit, I've frequently gotten
> "Selecting deleting buffer" errors.
Same here.
> 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).
My case is slightly different. I enable auto-revert-mode neither
locally nor globally, so Magit automatically enables
magit-auto-revert-mode instead.
This means that the killed buffers causing the auto-revert-buffers timer
to choke are present in auto-revert-buffer-list, rather than
(buffer-list).
Normally, killed buffers are removed from auto-revert-buffer-list thanks
to the local kill-buffer-hook function
auto-revert-remove-current-buffer.
But instrumenting get-buffer-create and kill-buffer revealed that
kill-buffer-hook wasn't run sometimes, specifically when an
uninitialised inhibit_buffer_hooks happened to be non-zero.
Eli, is the following TRT?
[0001-Don-t-leave-inhibit_buffer_hooks-uninitialized.patch (text/x-diff, inline)]
From 3c519bd52911db44bb3f92dcc722812d8d69a2c6 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Date: Sat, 6 Apr 2019 02:41:16 +0100
Subject: [PATCH] Don't leave inhibit_buffer_hooks uninitialized
* src/buffer.c (Fget_buffer_create): Explicitly initialize
inhibit_buffer_hooks. (bug#34847)
---
src/buffer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/buffer.c b/src/buffer.c
index c0f7521c9e..c5d8ee2629 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -588,6 +588,8 @@ even if it is dead. The return value is never nil. */)
&& strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name),
SBYTES (Vcode_conversion_workbuf_name)) == 0)
b->inhibit_buffer_hooks = true;
+ else
+ b->inhibit_buffer_hooks = false;
bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt);
--
2.20.1
[Message part 3 (text/plain, inline)]
Between Michael's patch[1] for autorevert.el and this, I think the issue
should be solved.
[1]: https://debbugs.gnu.org/34847#8
Thanks,
--
Basil
This bug report was last modified 6 years and 3 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.