From: Paul Eggert <eggert@cs.ucla.edu>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Stefan Kangas <stefan@marxist.se>, 37202@debbugs.gnu.org
Subject: bug#37202: shadowfile-tests: two failures on macOS
Date: Fri, 20 Sep 2019 12:04:41 -0700 [thread overview]
Message-ID: <8ba13523-7fbb-d341-0408-bd7e732bd248@cs.ucla.edu> (raw)
In-Reply-To: <871rwbqh5j.fsf@gmx.de>
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)))
next prev parent reply other threads:[~2019-09-20 19:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-28 0:41 bug#37202: shadowfile-tests: two failures on macOS Stefan Kangas
2019-08-28 8:18 ` Michael Albinus
2019-08-29 13:51 ` Michael Albinus
[not found] ` <CADwFkmkxp+NhTTuUg_kja-768nskD4JhbhTwTMKkwh4=QxfKjw@mail.gmail.com>
2019-09-03 12:12 ` Michael Albinus
2019-09-03 13:13 ` Stefan Kangas
2019-09-03 15:04 ` Michael Albinus
2019-09-04 12:16 ` Michael Albinus
2019-09-05 15:07 ` Stefan Kangas
2019-09-07 10:33 ` Michael Albinus
2019-09-07 12:45 ` Stefan Kangas
2019-09-08 8:21 ` Michael Albinus
2019-09-08 20:23 ` Stefan Kangas
2019-09-13 12:29 ` Michael Albinus
2019-09-14 16:39 ` Stefan Kangas
2019-09-15 14:56 ` Michael Albinus
2019-09-16 2:07 ` Stefan Kangas
2019-09-16 13:13 ` Michael Albinus
2019-09-16 19:52 ` Glenn Morris
2019-09-19 11:09 ` Michael Albinus
2019-09-20 0:19 ` Paul Eggert
2019-09-20 12:35 ` Michael Albinus
2019-09-20 19:04 ` Paul Eggert [this message]
2019-09-20 19:13 ` Michael Albinus
2019-09-21 7:55 ` Michael Albinus
2019-10-03 13:50 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8ba13523-7fbb-d341-0408-bd7e732bd248@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=37202@debbugs.gnu.org \
--cc=michael.albinus@gmx.de \
--cc=stefan@marxist.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).