GNU bug report logs -
#21337
25.0.50; inotify error message
Previous Next
Reported by: Robert Pluim <rpluim <at> gmail.com>
Date: Mon, 24 Aug 2015 12:13:02 UTC
Severity: normal
Merged with 21361
Found in version 25.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: 21337 <at> debbugs.gnu.org
> Date: Mon, 24 Aug 2015 20:32:59 +0200
>
> strace indicates that the directory where emacs is being run from is
> being watched, along with my home directory plus any directories
> containing files that are being visited. What's strange is that
> inotify_add_watch is being called 22 times for the current directory.
Can you see which code causes these 22 calls for the same directory?
> I've debugged inotify_callback a little. The expectation of this code
>
> to_read = 0;
> if (ioctl (fd, FIONREAD, &to_read) == -1)
> xsignal1
> (Qfile_notify_error,
> build_string ("Error while trying to retrieve file system events"));
> buffer = xmalloc (to_read);
> n = read (fd, buffer, to_read);
> if (n < 0)
> {
>
> is that the read will succeed, however to_read is very often 0, so
> it's not surprising the read fails.
That's strange, isn't it? If to_read is zero, how come pselect
indicated that FD has stuff to be read?
> (what does xmalloc do when its argument is 0?)
Nothing, usually.
> My understanding was that the callback should only be called when
> there are actual inotify events to process, so this behaviour is
> somewhat surprising to me.
Exactly.
Could it be that we are somehow trying to read the same event 22
times, and then only the 1st time succeeds?
> I can add in skipping the read if to_read == 0, but I suspect that's
> just papering over the cracks.
The important question is, IMO, how come pselect says this FD is ready
to be read, when there's nothing to be read.
Btw, it would be nice to have errno description added to the error
message.
Thanks.
This bug report was last modified 9 years and 261 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.