GNU bug report logs - #22859
25.0.91; Errors in auto-revert-notify-handler

Previous Next

Package: emacs;

Reported by: John Wiegley <johnw <at> gnu.org>

Date: Mon, 29 Feb 2016 20:34:01 UTC

Severity: normal

Found in version 25.0.91

Fixed in version 25.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22859 in the body.
You can then email your comments to 22859 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#22859; Package emacs. (Mon, 29 Feb 2016 20:34:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Wiegley <johnw <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 29 Feb 2016 20:34:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Wiegley <jwiegley <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.91; Errors in auto-revert-notify-handler
Date: Mon, 29 Feb 2016 12:27:35 -0800
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22859; Package emacs. (Wed, 02 Mar 2016 10:35:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#22859: 25.0.91; Errors in auto-revert-notify-handler
Date: Wed, 02 Mar 2016 11:34:42 +0100
John Wiegley <jwiegley <at> gmail.com> writes:

Hi John,

> However, I'm not performing any file renames. Perhaps this is due to the
> renaming of files used when creating backups?

Yes.

> 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?

Yes, it is file notification. The kqueue backend is inferior compared to
the other backends. In case of a file rename, it reports only the source
file name. The other backends report also the target file name.

I've fixed this by propagating a `deleted' event upwards in such
cases. autorevert falls back to the polling mode, as it should. If you
want to avoid this effect, you might set `backup-by-copying' to t.

Could you, pls, check whether the patch works for you? I've pushed it to
the emacs-25 branch.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22859; Package emacs. (Wed, 02 Mar 2016 22:31:01 GMT) Full text and rfc822 format available.

Message #11 received at 22859 <at> debbugs.gnu.org (full text, mbox):

From: John Wiegley <jwiegley <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 22859 <at> debbugs.gnu.org
Subject: Re: bug#22859: 25.0.91; Errors in auto-revert-notify-handler
Date: Wed, 02 Mar 2016 14:30:44 -0800
>>>>> Michael Albinus <michael.albinus <at> gmx.de> writes:

> I've fixed this by propagating a `deleted' event upwards in such cases.
> autorevert falls back to the polling mode, as it should. If you want to
> avoid this effect, you might set `backup-by-copying' to t.

But no matter what backup-by-copying is set to, we won't see the failing
rename event, right?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22859; Package emacs. (Thu, 03 Mar 2016 17:32:01 GMT) Full text and rfc822 format available.

Message #14 received at 22859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: John Wiegley <johnw <at> gnu.org>, 22859 <at> debbugs.gnu.org
Subject: Re: bug#22859: 25.0.91; Errors in auto-revert-notify-handler
Date: Thu, 03 Mar 2016 18:31:32 +0100
John Wiegley <jwiegley <at> gmail.com> writes:

>> I've fixed this by propagating a `deleted' event upwards in such cases.
>> autorevert falls back to the polling mode, as it should. If you want to
>> avoid this effect, you might set `backup-by-copying' to t.
>
> But no matter what backup-by-copying is set to, we won't see the failing
> rename event, right?

Yes.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22859; Package emacs. (Sun, 10 Apr 2016 08:20:01 GMT) Full text and rfc822 format available.

Message #17 received at 22859 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: 22859 <at> debbugs.gnu.org
Subject: Re: bug#22859: 25.0.91; Errors in auto-revert-notify-handler
Date: Sun, 10 Apr 2016 10:19:07 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi John,

> I've fixed this by propagating a `deleted' event upwards in such
> cases. autorevert falls back to the polling mode, as it should. If you
> want to avoid this effect, you might set `backup-by-copying' to t.
>
> Could you, pls, check whether the patch works for you? I've pushed it to
> the emacs-25 branch.

Do you still want to crosscheck the fix, or could I close the bug?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22859; Package emacs. (Mon, 11 Apr 2016 18:45:02 GMT) Full text and rfc822 format available.

Message #20 received at 22859 <at> debbugs.gnu.org (full text, mbox):

From: John Wiegley <jwiegley <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 22859 <at> debbugs.gnu.org
Subject: Re: bug#22859: 25.0.91; Errors in auto-revert-notify-handler
Date: Mon, 11 Apr 2016 11:44:46 -0700
>>>>> Michael Albinus <michael.albinus <at> gmx.de> 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.

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




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Tue, 12 Apr 2016 07:41:01 GMT) Full text and rfc822 format available.

Notification sent to John Wiegley <johnw <at> gnu.org>:
bug acknowledged by developer. (Tue, 12 Apr 2016 07:41:02 GMT) Full text and rfc822 format available.

Message #25 received at 22859-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: 22859-done <at> debbugs.gnu.org
Subject: Re: bug#22859: 25.0.91; Errors in auto-revert-notify-handler
Date: Tue, 12 Apr 2016 09:40:31 +0200
Version: 25.1

John Wiegley <jwiegley <at> gmail.com> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 10 May 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 126 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.