From unknown Sat Jun 21 12:25:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18880: 25.0.50; inotify-based file notifications missing sometimes Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Oct 2014 00:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18880 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 18880@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.141454149713989 (code B ref -1); Wed, 29 Oct 2014 00:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Oct 2014 00:11:37 +0000 Received: from localhost ([127.0.0.1]:38067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjGrQ-0003dX-Vf for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53961) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjGrO-0003dK-NV for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjGrD-00071W-5W for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGrD-00071S-37 for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGr7-00070F-Th for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjGr2-00070U-Qn for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:17 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:57425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGr2-00070P-IF for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:12 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C0F0F20BA5 for ; Tue, 28 Oct 2014 20:11:11 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Tue, 28 Oct 2014 20:11:11 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=s5q7GHmUb72GQmYraJ0dz0KES9I=; b=E81Z jRN2sXVLhj/gGkFGDsrnE3YCaJHQMC/UsBYrsLzy6yNk89Cfc2abjMkPOkjZNn7H w3j1+VkeX8IP2tkMTz++w6O7l1H7e+rEGrktd+zDFO7d4OH3kcOQ3Ni80LjerEBt QRNmo3qK6UnECkh5Q33OQk0+Z0k+bP/f2MlEJrQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=s5q7GHmUb72 GQmYraJ0dz0KES9I=; b=jDeDOP1dp9IPXXq8OvWhmegvxAyqKRmg/YlYKWODCLN Zj4BwqYumGEaCAcnd1aNAOz1LE9yP01QraygmpcgzqJikrIU24NWNbhIou5wQvqF m0LuhsJxarO3sEHkVG0Pt4f3Cvf/J0QRxSlPOWFgJKihS4sUrmOHbpoDc0GdcQm8 = X-Sasl-enc: pQnRLEf+vCDTsL0zkM11YuFYjwuE1C1orJWYuIJRcR1w 1414541471 Received: from shorty.local (unknown [23.243.192.221]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C131680142 for ; Tue, 28 Oct 2014 20:11:11 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XjGr0-0004y6-GF for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 17:11:10 -0700 From: Dima Kogan Date: Tue, 28 Oct 2014 17:11:10 -0700 Message-ID: <87sii7envl.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This bug is about an issue on the emacs-devel-mailing list: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00911.html The main message is copied below: I ran into an issue with inotify-base file notifications when looking at auto-revert stuff from an earlier thread. To show the issue, I build the latest emacs from source using ./configure --with-file-notification=inotify I then run ./emacs --eval "`cat /tmp/tstnotify.el`" -Q -nw with tstnotify.el being (progn (require 'filenotify) (dolist (fil '("/tmp/tst1" "/tmp/tst2")) (file-notify-add-watch fil '(change attribute-change) (lambda (event) (message "notify event %s" event))) (find-file fil)) (switch-to-buffer "*Messages*")) Here I ask for notifications for two files, and print out the events as they come in. While emacs is running this way, I modify those two files using an external tool. I would expect to see modification events for both of these files, but I only see them for one of the files. The issue is that emacs doesn't ask inotify to look at the two files, it asks it to look at the containing directory (/tmp in both cases), filtering out all the files we don't care about later. inotify is being intelligent, notices that we're asking to monitor the same object twice (/tmp), and simply returns the same descriptor a second time. Emacs is assuming a unique descriptor, and the result is that we only get notifications for one file. From unknown Sat Jun 21 12:25:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18880: 25.0.50; inotify-based file notifications missing sometimes Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Jan 2015 10:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18880 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dima Kogan Cc: 18880@debbugs.gnu.org Received: via spool by 18880-submit@debbugs.gnu.org id=B18880.142114500832494 (code B ref 18880); Tue, 13 Jan 2015 10:31:02 +0000 Received: (at 18880) by debbugs.gnu.org; 13 Jan 2015 10:30:08 +0000 Received: from localhost ([127.0.0.1]:54987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YAyje-0008Ry-Oz for submit@debbugs.gnu.org; Tue, 13 Jan 2015 05:30:07 -0500 Received: from mout.gmx.net ([212.227.15.18]:59112) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YAyja-0008Qx-OH for 18880@debbugs.gnu.org; Tue, 13 Jan 2015 05:30:04 -0500 Received: from detlef.gmx.de ([87.146.34.223]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LgHvY-1XNIRB2CVI-00njee; Tue, 13 Jan 2015 11:29:53 +0100 From: Michael Albinus References: <87sii7envl.fsf@secretsauce.net> Date: Tue, 13 Jan 2015 11:29:52 +0100 In-Reply-To: <87sii7envl.fsf@secretsauce.net> (Dima Kogan's message of "Tue, 28 Oct 2014 17:11:10 -0700") Message-ID: <87twzv6kin.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:mcWXetWqxpJUpRP3eZovGEUTFH6xYfZccgmXijTH/MSSksU4GXO OCndQ1e6XzvYcOuMSUSZaaZYw5puFcwRme6hyiiDfbCE6nl98jzYa/+zHeO8bsLp82W8tvT TFTpGoVt+3chNgG/IFroLmNfTxxRTK8qef/jDJduhISq+8NizNY0Ozc4tcaLtMlNJDM14LV 4R+1ZgkqjPU0FWkHDPqKg== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dima Kogan writes: > The issue is that emacs doesn't ask inotify to look at the two files, it > asks it to look at the containing directory (/tmp in both cases), > filtering out all the files we don't care about later. inotify is being > intelligent, notices that we're asking to monitor the same object twice > (/tmp), and simply returns the same descriptor a second time. Emacs is > assuming a unique descriptor, and the result is that we only get > notifications for one file. I've committed a patch to the emacs-24 branch; could you, please, check? Best regards, Michael. From unknown Sat Jun 21 12:25:46 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dima Kogan Subject: bug#18880: closed (Re: bug#18880: 25.0.50; inotify-based file notifications missing sometimes) Message-ID: References: <87iof0uyhf.fsf@gmx.de> <87sii7envl.fsf@secretsauce.net> X-Gnu-PR-Message: they-closed 18880 X-Gnu-PR-Package: emacs Reply-To: 18880@debbugs.gnu.org Date: Tue, 17 Feb 2015 19:32:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1424201523-18251-1" This is a multi-part message in MIME format... ------------=_1424201523-18251-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #18880: 25.0.50; inotify-based file notifications missing sometimes which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 18880@debbugs.gnu.org. --=20 18880: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18880 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1424201523-18251-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 18880-done) by debbugs.gnu.org; 17 Feb 2015 19:31:12 +0000 Received: from localhost ([127.0.0.1]:46617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNnrT-0004U6-6X for submit@debbugs.gnu.org; Tue, 17 Feb 2015 14:31:11 -0500 Received: from mout.gmx.net ([212.227.17.22]:64765) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNnrR-0004Mv-8P for 18880-done@debbugs.gnu.org; Tue, 17 Feb 2015 14:31:10 -0500 Received: from detlef.gmx.de ([79.195.24.178]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MRkhB-1XzRTU0nVZ-00SxLX; Tue, 17 Feb 2015 20:30:57 +0100 From: Michael Albinus To: Dima Kogan Subject: Re: bug#18880: 25.0.50; inotify-based file notifications missing sometimes References: <87sii7envl.fsf@secretsauce.net> <87twzv6kin.fsf@gmx.de> Date: Tue, 17 Feb 2015 20:30:52 +0100 In-Reply-To: <87twzv6kin.fsf@gmx.de> (Michael Albinus's message of "Tue, 13 Jan 2015 11:29:52 +0100") Message-ID: <87iof0uyhf.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:cnTWY3vCW+OoA+jJ7EaS6UIiMR2raRHCmLNSLkJuj3uMlmNeZ72 mWORhnCiSIlFHBhRyQOCFTdzXyWO6kSIG2J74u/iFdHL+85M9J0te4sQaduRHi00bemHmfU LoFTqPWOL0T59jjMmPgMzNRMUQykAiP2DMjLT/a007DOpKNG7C09GO0z+RoLyMoFgAT9jgD OY3fXOTulWTWMa8Fyg+4g== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18880-done Cc: 18880-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Version: 24.5 Michael Albinus writes: > I've committed a patch to the emacs-24 branch; could you, please, check? No reaction for weeks; I set this bug as closed. If there are still problems, please reopen. Best regards, Michael. ------------=_1424201523-18251-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 Oct 2014 00:11:37 +0000 Received: from localhost ([127.0.0.1]:38067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjGrQ-0003dX-Vf for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53961) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjGrO-0003dK-NV for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjGrD-00071W-5W for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGrD-00071S-37 for submit@debbugs.gnu.org; Tue, 28 Oct 2014 20:11:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGr7-00070F-Th for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjGr2-00070U-Qn for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:17 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:57425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjGr2-00070P-IF for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:11:12 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C0F0F20BA5 for ; Tue, 28 Oct 2014 20:11:11 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Tue, 28 Oct 2014 20:11:11 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=s5q7GHmUb72GQmYraJ0dz0KES9I=; b=E81Z jRN2sXVLhj/gGkFGDsrnE3YCaJHQMC/UsBYrsLzy6yNk89Cfc2abjMkPOkjZNn7H w3j1+VkeX8IP2tkMTz++w6O7l1H7e+rEGrktd+zDFO7d4OH3kcOQ3Ni80LjerEBt QRNmo3qK6UnECkh5Q33OQk0+Z0k+bP/f2MlEJrQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=s5q7GHmUb72 GQmYraJ0dz0KES9I=; b=jDeDOP1dp9IPXXq8OvWhmegvxAyqKRmg/YlYKWODCLN Zj4BwqYumGEaCAcnd1aNAOz1LE9yP01QraygmpcgzqJikrIU24NWNbhIou5wQvqF m0LuhsJxarO3sEHkVG0Pt4f3Cvf/J0QRxSlPOWFgJKihS4sUrmOHbpoDc0GdcQm8 = X-Sasl-enc: pQnRLEf+vCDTsL0zkM11YuFYjwuE1C1orJWYuIJRcR1w 1414541471 Received: from shorty.local (unknown [23.243.192.221]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C131680142 for ; Tue, 28 Oct 2014 20:11:11 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XjGr0-0004y6-GF for bug-gnu-emacs@gnu.org; Tue, 28 Oct 2014 17:11:10 -0700 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 25.0.50; inotify-based file notifications missing sometimes Date: Tue, 28 Oct 2014 17:11:10 -0700 Message-ID: <87sii7envl.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This bug is about an issue on the emacs-devel-mailing list: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00911.html The main message is copied below: I ran into an issue with inotify-base file notifications when looking at auto-revert stuff from an earlier thread. To show the issue, I build the latest emacs from source using ./configure --with-file-notification=inotify I then run ./emacs --eval "`cat /tmp/tstnotify.el`" -Q -nw with tstnotify.el being (progn (require 'filenotify) (dolist (fil '("/tmp/tst1" "/tmp/tst2")) (file-notify-add-watch fil '(change attribute-change) (lambda (event) (message "notify event %s" event))) (find-file fil)) (switch-to-buffer "*Messages*")) Here I ask for notifications for two files, and print out the events as they come in. While emacs is running this way, I modify those two files using an external tool. I would expect to see modification events for both of these files, but I only see them for one of the files. The issue is that emacs doesn't ask inotify to look at the two files, it asks it to look at the containing directory (/tmp in both cases), filtering out all the files we don't care about later. inotify is being intelligent, notices that we're asking to monitor the same object twice (/tmp), and simply returns the same descriptor a second time. Emacs is assuming a unique descriptor, and the result is that we only get notifications for one file. ------------=_1424201523-18251-1--