GNU bug report logs - #21435
25.0.50; file-notify has problems after renames

Previous Next

Package: emacs;

Reported by: Tassilo Horn <tsdh <at> gnu.org>

Date: Tue, 8 Sep 2015 08:48:01 UTC

Severity: normal

Found in version 25.0.50

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: 21435 <at> debbugs.gnu.org
Subject: bug#21435: 25.0.50; file-notify has problems after renames
Date: Tue, 08 Sep 2015 22:19:38 +0300
> From: Tassilo Horn <tsdh <at> gnu.org>
> Cc: 21435 <at> debbugs.gnu.org
> Date: Tue, 08 Sep 2015 21:05:00 +0200
> 
> I stepped through inotify_callback in inotify.c which can read 64 byte
> from inotifyfd where the size of one inotify event is 32 and that
> produces 2 emacs events (although I cannot see which events are
> created).  The Locals GUD frame always shows just nil for the `event'
> local variable even after the assignments to it and I stepped into the
> then-branch of an `if (!NILP(event.arg))' which makes it pretty clear
> that it cannot be nil.  Why is that?

Could be some gud bug.  Do you see the same when you invoke GDB from
the shell?

> Then I turned to `file-notify-callback'.  That receives one `move-from'
> event and one `move-to' event which I figured out by adding a message.
> The problem is that as soon as I edebug the function, I can only see the
> first call for the `mode-from' event.  After stepping through it, I
> won't be put into the debugger for the second event as if it has been
> discarded in the meantime.  My handle function is also not run when
> edebugging.  Is that expected that when edebugging event handlers one
> might miss events?

I always use 'message' when debugging event-driven code.  I just don't
trust edebug enough in these cases.

> Anyway, eventually I found and fixed the culprit which simply was that
> the watch descriptors of the pending and the current event were compared
> with `eq' which is not valid because inotify descriptors are conses.
> I've changed the comparison to `equal' which fixes the double-reporting
> issue.

Thanks.  But meanwhile Michale explained that this behavior was on
purpose, due to a recent change.  Do you see 2 events only when a file
was moved to a different directory, or also when it is renamed in the
same directory?




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

Previous Next


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