GNU bug report logs -
#14479
[PATCH] Infinite loop when error in auto-save-hook
Previous Next
Reported by: Kelly Dean <kellydeanch <at> yahoo.com>
Date: Mon, 27 May 2013 01:24:01 UTC
Severity: normal
Tags: patch
Fixed in version 24.4
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Thu, 13 Jun 2013 01:13:36 -0400
with message-id <6imwqu4mpr.fsf <at> fencepost.gnu.org>
and subject line Re: bug#14479: [PATCH] Infinite loop when error in auto-save-hook
has caused the debbugs.gnu.org bug report #14479,
regarding [PATCH] Infinite loop when error in auto-save-hook
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
14479: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14479
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Put in init.el:
(setq inhibit-startup-screen t)
(add-hook 'auto-save-hook (lambda () (error "Foo")))
(setq auto-save-interval 30)
(switch-to-buffer "*Messages*")
Start Emacs 24.3, then press any key 31 times. It prints "Foo" and begins benchmarking an autosave retry loop, on my system about 300 retries/second, because Fdo_auto_save fails when it tries to run auto-save-hook, so it never gets to record_auto_save which updates last_auto_save, which is what's supposed to prevent the retries via keyboard.c line 2608.
The patch below fixes it. Unlike the case for post-command-hook, removing the offending auto-save hook isn't vital, but I think it's the best thing to do. Anyway, continuing the autosave despite the error is vital, and safe_run_hooks is the easiest way to accomplish both.
--- emacs-24.3/src/fileio.c
+++ emacs-24.3/src/fileio.c
@@ -5445,7 +5445,7 @@
point to non-strings reached from Vbuffer_alist. */
hook = intern ("auto-save-hook");
- Frun_hooks (1, &hook);
+ safe_run_hooks (hook);
if (STRINGP (Vauto_save_list_file_name))
{
[Message part 3 (message/rfc822, inline)]
Version: 24.4
Thanks; applied.
This bug report was last modified 11 years and 346 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.