Subject: Re: bug#13149: 24.3.50; Emacs thinks file was changed outside Emacs, but it was not

From: Dmitry Gutov <[email-masked]>
Date: Wed, 16 Jan 2013 03:09:53 +0400

On 16.01.2013 2:38, Paul Eggert wrote:
> On 01/15/13 14:11, Dmitry Gutov wrote:
>
>> Here you go:
>
> Sorry, what scenario are you using for that?

Sorry, in that and previous messages, I only posted the part I supposed 
relevant, which is after the file is opened.

> Here's what I get when I run "src/emacs -Q /tmp/r" and type "a C-x C-s b".
> In this transcript I indicate exactly when I typed each character.
>
> ...
>
> You're evidently getting different behavior, since you don't see
> lread.c at all, for example.  If I'm guessing right, I think the key
> sequence in your transcript is here:
>
> fileio.c:5359: stat_mtime=1358287604.023708900
> fileio.c:5020: stat_mtime=1358287610.000000000
> dired.c:958: stat_mtime=1358287613.927966600
> fileio.c:5359: stat_mtime=1358287613.927966600
>
> and that this corresponds to the last 5 lines of my transcript.
>
> What happens if you apply the following patch as well?
> Does it cause Emacs to output "fstat and lstat disagree!"?

It does!

Here's the more detailed log:

$ src/emacs -Q
fileio.c:3581: stat_mtime=1358290106.959122882
fileio.c:3581: stat_mtime=1358290027.851586258
dired.c:958: stat_mtime=1358289897.278327924
dired.c:958: stat_mtime=1358289897.278327924
fileio.c:3581: stat_mtime=1341302771.000000000
fileio.c:3581: stat_mtime=1358138630.713864000
lread.c:1228: stat_mtime=1358194311.328310000
lread.c:1228: stat_mtime=1358290456.533834487
find-file
dired.c:958: stat_mtime=1358291126.115457800
dired.c:958: stat_mtime=1358291126.115457800
fileio.c:3581: stat_mtime=1358291126.115457800
fileio.c:3363: stat_mtime=1358291126.115457800
fileio.c:3363: stat_mtime=1358285614.014009800
lread.c:1228: stat_mtime=1358194311.328310000
lread.c:1228: stat_mtime=1358290442.274708012
modify
fileio.c:5373: stat_mtime=1358291126.115457800
save-buffer
fileio.c:5373: stat_mtime=1358291126.115457800
dired.c:958: stat_mtime=1358291126.115457800
dired.c:958: stat_mtime=1358291126.115457800
dired.c:958: stat_mtime=1358291126.115457800
fileio.c:2200: stat_mtime=1358291126.115457800
fileio.c:5373: stat_mtime=1358291126.115457800
fileio.c:5020: stat_mtime=1358291194.000000000
fileio.c:5037: stat_mtime=1358291196.726424200
fstat and lstat disagree!
dired.c:958: stat_mtime=1358291196.726424200
modify again
fileio.c:5373: stat_mtime=1358291196.726424200
lread.c:1228: stat_mtime=1358194311.328310000
lread.c:1228: stat_mtime=1358290142.953112077
y
save-buffer again
fileio.c:5373: stat_mtime=1358291196.726424200
yes
dired.c:958: stat_mtime=1358291196.726424200
dired.c:958: stat_mtime=1358291196.726424200
dired.c:958: stat_mtime=1358291196.726424200
fileio.c:2200: stat_mtime=1358291196.726424200
fileio.c:5373: stat_mtime=1358291196.726424200
y
fileio.c:5020: stat_mtime=1358291233.000000000
fileio.c:5037: stat_mtime=1358291234.976781400
fstat and lstat disagree!
dired.c:958: stat_mtime=1358291234.976781400