From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#37202: shadowfile-tests: two failures on macOS Date: Fri, 20 Sep 2019 12:04:41 -0700 Organization: UCLA Computer Science Department Message-ID: <8ba13523-7fbb-d341-0408-bd7e732bd248@cs.ucla.edu> References: <871rx5wvmo.fsf@gmx.de> <87blw8oz9d.fsf@gmx.de> <87muflpoiz.fsf@gmx.de> <87ftlcxnm0.fsf@gmx.de> <8736h8mm48.fsf@gmx.de> <87y2yzkxle.fsf@gmx.de> <87a7b8idm1.fsf@gmx.de> <87woe9halp.fsf@gmx.de> <871rwck0e1.fsf@gmx.de> <62ea6270-30a8-fe82-e9ed-e12a733b6983@cs.ucla.edu> <871rwbqh5j.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="233288"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: Stefan Kangas , 37202@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 20 21:05:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iBODV-000yZb-Ng for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Sep 2019 21:05:17 +0200 Original-Received: from localhost ([::1]:34824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBODU-0000Rc-7H for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Sep 2019 15:05:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56641) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBODI-0000Pq-T8 for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2019 15:05:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBODH-0005X3-TO for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2019 15:05:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49698) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBODH-0005Wt-P5 for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2019 15:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iBODG-0007UK-8W for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2019 15:05:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2019 19:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37202 X-GNU-PR-Package: emacs Original-Received: via spool by 37202-submit@debbugs.gnu.org id=B37202.156900629028758 (code B ref 37202); Fri, 20 Sep 2019 19:05:02 +0000 Original-Received: (at 37202) by debbugs.gnu.org; 20 Sep 2019 19:04:50 +0000 Original-Received: from localhost ([127.0.0.1]:58519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBOD4-0007Tm-GV for submit@debbugs.gnu.org; Fri, 20 Sep 2019 15:04:50 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:42574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBOD2-0007TS-0n for 37202@debbugs.gnu.org; Fri, 20 Sep 2019 15:04:48 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6A4241600B0; Fri, 20 Sep 2019 12:04:42 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id jZ_67N5w73qI; Fri, 20 Sep 2019 12:04:41 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A9E701600C2; Fri, 20 Sep 2019 12:04:41 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qk2zn2NnfqTO; Fri, 20 Sep 2019 12:04:41 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 7B6581600B0; Fri, 20 Sep 2019 12:04:41 -0700 (PDT) In-Reply-To: <871rwbqh5j.fsf@gmx.de> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:166789 Archived-At: On 9/20/19 5:35 AM, Michael Albinus wrote: > That means, (file-attributes truename) returns nil although > (file-exists-p truename) returns non-nil. I don't see why the recent changes would cause file-attributes to return nil on a local file. If file-exists-p succeeds, the file has been confirmed to exist. In that case, when file-attributes uses fstatat (or openat+stat) the syscalls should either succeed, or should fail with an unusual errno value like EOVERFLOW, so file-attributes should either return non-nil or signal an error. Perhaps the file in question has file handlers that are interposing themselves? That might explain the situation. I should mention that under Emacs 26 file-attributes can return nil here, even for a local file: e.g., (file-exists-p F) uses faccessat which succeeds, then (file-attributes F) uses fstatat (or openat+fstat) which fails with errno==EOVERFLOW because F's timestamp or inode number is out of range for the kernel. Also, of course using two calls suffers from a race if the filesystem changes between the calls. So, regardless of the the recent access changes, it appears that this code in tramp-handle-file-modes: (when (file-exists-p truename) (tramp-mode-string-to-int (tramp-compat-file-attribute-modes (file-attributes truename)))) should be rewritten to be something like this: (when-let ((attrs (file-attributes truename))) (tramp-mode-string-to-int (tramp-compat-file-attribute-modes attrs)))