Subject: bug#22859: closed (Re: bug#22859: 25.0.91; Errors in auto-revert-notify-handler)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 12 Apr 2016 07:41:02 +0000

Your bug report

#22859: 25.0.91; Errors in auto-revert-notify-handler

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
22859: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22859
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#22859: 25.0.91; Errors in auto-revert-notify-handler
From: Michael Albinus <[email-masked]>
To: John Wiegley <[email-masked]>
Cc: [email-masked]
Date: Tue, 12 Apr 2016 09:40:31 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 25.1

John Wiegley <[email-masked]> writes:

>> Do you still want to crosscheck the fix, or could I close the bug?
>
> I haven't noticed the problem since you pushed that fix, so it appears
> resolved to me.

Thanks for confirmation, I'm closing the bug.

Best regards, Michael.

Subject: 25.0.91; Errors in auto-revert-notify-handler
From: John Wiegley <[email-masked]>
To: [email-masked]
Date: Mon, 29 Feb 2016 12:27:35 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

While doing general editing and saving of files with emacs-25, I'm getting the
following backtrace somewhat often:

--8<---------------cut here---------------start------------->8---
Debugger entered: ((cl-assertion-failed (stringp file1) nil))
  cl--assertion-failed((stringp file1))
  auto-revert-notify-handler((29 renamed "/Users/johnw/bae/rings/vignettes/simple_parser_fiat/Main.hs"))
  file-notify-callback((29 (rename) "/Users/johnw/bae/rings/vignettes/simple_parser_fiat/Main.hs"))
  file-notify-handle-event((file-notify (29 (rename) "/Users/johnw/bae/rings/vignettes/simple_parser_fiat/Main.hs") file-notify-callback))
  funcall-interactively(file-notify-handle-event (file-notify (29 (rename) "/Users/johnw/bae/rings/vignettes/simple_parser_fiat/Main.hs") file-notify-callback))
  call-interactively(file-notify-handle-event nil [(file-notify (29 (rename) "/Users/johnw/bae/rings/vignettes/simple_parser_fiat/Main.hs") file-notify-callback)])
  command-execute(file-notify-handle-event nil [(file-notify (29 (rename) "/Users/johnw/bae/rings/vignettes/simple_parser_fiat/Main.hs") file-notify-callback)] t)
--8<---------------cut here---------------end--------------->8---

The responsible code, in autorevert.el:

--8<---------------cut here---------------start------------->8---
(defun auto-revert-notify-handler (event)
  "Handle an EVENT returned from file notification."
  (with-demoted-errors
    (let* ((descriptor (car event))
	   (action (nth 1 event))
	   (file (nth 2 event))
	   (file1 (nth 3 event)) ;; Target of `renamed'.
	   (buffers (gethash descriptor
			     auto-revert-notify-watch-descriptor-hash-list)))
      ;; Check, that event is meant for us.
      (cl-assert descriptor)
      ;; Since we watch a directory, a file name must be returned.
      (cl-assert (stringp file))
      (when (eq action 'renamed) (cl-assert (stringp file1)))
--8<---------------cut here---------------end--------------->8---

However, I'm not performing any file renames. Perhaps this is due to the
renaming of files used when creating backups? What code might be raising a
rename enough without a rename target? From a cursory inspection, it looks
like it might be the file notification logic?

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2