From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#13149: 24.3.50; Emacs thinks file was changed outside Emacs, but it was not Date: Tue, 15 Jan 2013 14:38:16 -0800 Message-ID: <50F5DA58.3020404@cs.ucla.edu> References: <6CDE13E3BCAA4AFAAB8BCE105C6ABF12@us.oracle.com> <874njs19zb.fsf@yandex.ru> <50F3935A.2090003@yandex.ru> <50F41CE7.60306@gmail.com> <50F44E6B.8090007@cs.ucla.edu> <50F484CB.6010905@gmail.com> <50F4FB0B.5070003@cs.ucla.edu> <50F5192B.602@yandex.ru> <50F5928A.9010009@cs.ucla.edu> <50F5CC3D.5090802@yandex.ru> <50F5CE65.9030002@cs.ucla.edu> <50F5D3F5.6050604@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1358289517 15401 80.91.229.3 (15 Jan 2013 22:38:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2013 22:38:37 +0000 (UTC) Cc: 13149@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 15 23:38:53 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TvF9g-0002lZ-I6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 23:38:52 +0100 Original-Received: from localhost ([::1]:52307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvF9Q-0007mv-7i for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 17:38:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvF9M-0007mb-Jf for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 17:38:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvF9L-0003bj-4X for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 17:38:32 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvF9L-0003bc-16 for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 17:38:31 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TvF9q-0002rh-DH for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 17:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Jan 2013 22:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13149 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: unreproducible moreinfo Original-Received: via spool by 13149-submit@debbugs.gnu.org id=B13149.135828953610995 (code B ref 13149); Tue, 15 Jan 2013 22:39:02 +0000 Original-Received: (at 13149) by debbugs.gnu.org; 15 Jan 2013 22:38:56 +0000 Original-Received: from localhost ([127.0.0.1]:34004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TvF9j-0002rI-IG for submit@debbugs.gnu.org; Tue, 15 Jan 2013 17:38:55 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:57120) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TvF9e-0002r8-8O for 13149@debbugs.gnu.org; Tue, 15 Jan 2013 17:38:51 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 8A47D39E810E; Tue, 15 Jan 2013 14:38:17 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ht-29A3GnAWC; Tue, 15 Jan 2013 14:38:17 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 0CFC239E8105; Tue, 15 Jan 2013 14:38:17 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <50F5D3F5.6050604@yandex.ru> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:69840 Archived-At: On 01/15/13 14:11, Dmitry Gutov wrote: > Here you go: Sorry, what scenario are you using for that? 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. fileio.c:3573: stat_mtime=1358285891.979499498 fileio.c:3573: stat_mtime=1358185278.123368557 dired.c:958: stat_mtime=1358285832.923323363 dired.c:958: stat_mtime=1358285832.923323363 fileio.c:3573: stat_mtime=1339474634.000000000 fileio.c:3573: stat_mtime=1357144798.955079131 lread.c:1228: stat_mtime=1357144798.939079049 lread.c:1228: stat_mtime=1358185424.004185658 dired.c:958: stat_mtime=1358288328.739209633 dired.c:958: stat_mtime=1358288328.739209633 fileio.c:3573: stat_mtime=1358288328.739209633 fileio.c:3363: stat_mtime=1358288328.739209633 fileio.c:3363: stat_mtime=1358288344.827280766 a fileio.c:5350: stat_mtime=1358288328.739209633 C-x C-s fileio.c:5350: stat_mtime=1358288328.739209633 fileio.c:5350: stat_mtime=1358288328.739209633 fileio.c:5011: stat_mtime=1358288369.760392065 dired.c:958: stat_mtime=1358288369.760392065 b fileio.c:5350: stat_mtime=1358288369.760392065 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!"? === modified file 'src/fileio.c' --- src/fileio.c 2013-01-15 10:14:31 +0000 +++ src/fileio.c 2013-01-15 22:35:57 +0000 @@ -5017,6 +5017,20 @@ This calls `write-region-annotate-functi if (emacs_close (desc) < 0) ok = 0, save_errno = errno; + if (ok && visiting) + { + struct stat st1; + EMACS_TIME modtime1; + if (lstat (fn, &st1) != 0) + perror (fn); + else + { + modtime1 = get_stat_mtime (&st1); + if (! EMACS_TIME_EQ (modtime, modtime1)) + fprintf (stderr, "fstat and lstat disagree!\n"); + } + } + /* Discard the unwind protect for close_file_unwind. */ specpdl_ptr = specpdl + count1;