GNU bug report logs - #37202
shadowfile-tests: two failures on macOS

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Wed, 28 Aug 2019 00:42:02 UTC

Severity: normal

Fixed in version 27.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Glenn Morris <rgm <at> gnu.org>, Stefan Kangas <stefan <at> marxist.se>, 37202 <at> debbugs.gnu.org
Subject: bug#37202: shadowfile-tests: two failures on macOS
Date: Fri, 20 Sep 2019 12:04:41 -0700
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)))




This bug report was last modified 5 years and 227 days ago.

Previous Next


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