GNU bug report logs - #41414
28.0.50; `find-file-noselect' + `file-truename' gotcha

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Michael Heerdegen <michael_heerdegen@HIDDEN>; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 29.1, send any further explanations to 41414 <at> debbugs.gnu.org and Michael Heerdegen <michael_heerdegen@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 41414 <at> debbugs.gnu.org:


Received: (at 41414) by debbugs.gnu.org; 6 Jun 2022 13:51:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 06 09:51:16 2022
Received: from localhost ([127.0.0.1]:34769 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nyD8I-0008Nv-6W
	for submit <at> debbugs.gnu.org; Mon, 06 Jun 2022 09:51:16 -0400
Received: from quimby.gnus.org ([95.216.78.240]:40216)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nyD8F-0008NH-Kj
 for 41414 <at> debbugs.gnu.org; Mon, 06 Jun 2022 09:51:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=b0ME4K7LmF/yLhYqwjBS28LxEitQyIWsQxQ+XhNmqNI=; b=tRkyfOn9BgMSA5bJI0cPsFUVuF
 GkdaVfhNH6S/q0eQNK1cwkymhIOiV2/FPPi51Gc+ePb+LbbKMREW4U+8aHhIihlT3ZYTUXdFCayd3
 /1npZ/58DvNESaL0jX2xorRG6/kS7W0lekqGo8SRYCPlapHvajonE2kWe1OeZV177AKk=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nyD86-0003Rb-Ds; Mon, 06 Jun 2022 15:50:52 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#41414: 28.0.50; `find-file-noselect' + `file-truename' gotcha
References: <87eerffnq4.fsf@HIDDEN>
X-Now-Playing: Jay Phlitman and Kim Kangaroo's _Tuxedomooning: A Tribute_:
 "Ninotchka"
Date: Mon, 06 Jun 2022 15:50:49 +0200
In-Reply-To: <87eerffnq4.fsf@HIDDEN> (Michael Heerdegen's message of "Wed, 20
 May 2020 02:34:43 +0200")
Message-ID: <87fskhvr2e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael Heerdegen <michael_heerdegen@HIDDEN> writes: > Here
 is a recipe,
 I start with a directory like this: > > /home/micha/Treasure/today/test:
 > total used in directory 29 available 123.8 GiB > drwxrwxr-x 2 micha micha
 4k 05-20 02:20 . > drwxr-xr-x 6 [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 41414
Cc: 41414 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Michael Heerdegen <michael_heerdegen@HIDDEN> writes:

> Here is a recipe, I start with a directory like this:
>
>   /home/micha/Treasure/today/test:
>   total used in directory 29 available 123.8 GiB
>   drwxrwxr-x  2 micha micha     4k 05-20 02:20 .
>   drwxr-xr-x 69 micha micha    24k 05-20 02:19 ..
>   -rw-rw-r--  1 micha micha      5 05-20 02:20 a
> S lrwxrwxrwx  1 micha micha      1 05-20 02:21 b -> a
>
> I visit b (I did that from dired), then, without killing the b visiting
> buffer, I delete the b -> a symlink, then I try to visit "a" and get:
>
> Debugger entered--Lisp error: (error "File /home/micha/today/test/b no
> longer exists!")
>   signal(error ("File /home/micha/today/test/b no longer exists!"))
>   error("File %s no longer exists!" "/home/micha/today/test/b")

This no longer happens in Emacs 29, but the subsequent problems are
still present.  That is, trying to revert the buffer etc will lead to
errors.

So I've now changed find-file-noselect to ignore buffers with file names
that no longer exist in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#41414; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 May 2020 00:34:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 19 20:34:50 2020
Received: from localhost ([127.0.0.1]:51587 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jbCh8-0000ij-6r
	for submit <at> debbugs.gnu.org; Tue, 19 May 2020 20:34:50 -0400
Received: from lists.gnu.org ([209.51.188.17]:54136)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1jbCh6-0000ic-CJ
 for submit <at> debbugs.gnu.org; Tue, 19 May 2020 20:34:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56846)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1jbCh6-0003mP-5M
 for bug-gnu-emacs@HIDDEN; Tue, 19 May 2020 20:34:48 -0400
Received: from mout.web.de ([217.72.192.78]:58627)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1jbCh5-0003Xx-1A
 for bug-gnu-emacs@HIDDEN; Tue, 19 May 2020 20:34:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1589934884;
 bh=UrRnb0zAzXuqSjlep6ifbekh5upk1BXbqRbbEYkNvh4=;
 h=X-UI-Sender-Class:From:To:Subject:Date;
 b=T+yZiuo/OcXG0EyFdUbW9unLqVX2YogtSG4KxPp+wF/uULgAtFYwjUcB+U4Ndt59p
 QVpmeMRk9nc7T4byPUm3NNbpQFKVO/xsrXOGZ8LT/TOPukaaNc3/hTJ7b5E+ulugL5
 CDbG/P0tP4GRW0fTZbWjza3djbX4bbS2zQbqjimo=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([188.98.100.187]) by smtp.web.de (mrweb103
 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lnj7L-1j8Rad28lj-00hvQu; Wed, 20
 May 2020 02:34:44 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; `find-file-noselect' + `file-truename' gotcha
Date: Wed, 20 May 2020 02:34:43 +0200
Message-ID: <87eerffnq4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:Iqtq5fjOxoBg6DigwdQ944IvTaja9z9eRC5CYugSORbuHq3Dkw/
 linS7M8G1NYTIJtjyw+yzIF8++0+jzCJQ8nz34WVClIxbCT7yGmeKHcp84KZ0qPnP5mEYBT
 4CtvOzxhdk/hd9pRRefbccLhviogRIc3huD9Ce+1JtrqZhqG87u7Vo37BXBNgnAC0JbFneh
 BoYZkZjoOUw1Em/5yUaVQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:cQRxUWB9YoI=:Tx/zM5kQN+w430ngt69sww
 D0D5Sw/tVRi1ymd/WNGBVQrYVTScDeD9e0lF6LAsQpjNZafxLdOmxULQksJulCXvUFWWgG8vG
 YjAWwEyCe/uSxPcGO+ChPTjtKQ+AMoKvcU+l/g1d+oicXryviniOc1RrdVo/Xhfdhl+9yh9oy
 tr3sXNkeKKJ3DI4qpb7P9fiNbf+6CPTer+K1D7P6DE0Oj4ALWnR7E/zjKvv3aZ4mTCOvv7kVh
 4AXkUg9OKLYBi3eypfWTFfOpFhXfxjJvSXVaSreKHqNdBUkV2ZONWa2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ected-operating-system: by eggs.gnu.org: First seen = 2020/05/19 20:34:45
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic]
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: 0.6 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)


Hello,

`find-file-noselect' tries to reuse buffers already visiting the file
under a different name, e.g. via a symlink, but it doesn't check if that
name is still valid (which is not the case when the symlink has been
deleted after the file has been visited using this name).  The behavior
makes it hard to visit the file under its valid name because Emacs
tries to revert the existing buffer which fails.

Here is a recipe, I start with a directory like this:

  /home/micha/Treasure/today/test:
  total used in directory 29 available 123.8 GiB
  drwxrwxr-x  2 micha micha     4k 05-20 02:20 .
  drwxr-xr-x 69 micha micha    24k 05-20 02:19 ..
  -rw-rw-r--  1 micha micha      5 05-20 02:20 a
S lrwxrwxrwx  1 micha micha      1 05-20 02:21 b -> a

I visit b (I did that from dired), then, without killing the b visiting
buffer, I delete the b -> a symlink, then I try to visit "a" and get:

Debugger entered--Lisp error: (error "File /home/micha/today/test/b no longer exists!")
  signal(error ("File /home/micha/today/test/b no longer exists!"))
  error("File %s no longer exists!" "/home/micha/today/test/b")
  revert-buffer-insert-file-contents--default-function("/home/micha/today/test/b" nil)
  revert-buffer--default(t t)
  revert-buffer(t t)
  find-file-noselect("/home/micha/today/test/a")
  view-file("/home/micha/today/test/a")
  dired-view-file()
  funcall-interactively(dired-view-file)
  call-interactively(dired-view-file nil nil)
  command-execute(dired-view-file)

Depending on `revert-without-query' you are asked whether to revert the
"b" buffer.  That will fail.  That "b" buffer should better be ignored
by Emacs to avoid confusion.

Thanks,

Michael.







Acknowledgement sent to Michael Heerdegen <michael_heerdegen@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#41414; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 6 Jun 2022 14:00:02 UTC

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