* strange build error today: "Renaming: Invalid argument"
@ 2017-08-03 20:41 Ted Zlatanov
2017-08-03 20:57 ` Paul Eggert
0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2017-08-03 20:41 UTC (permalink / raw)
To: emacs-devel
I did `make bootstrap` to no avail. FWIW I'm using an encrypted
partition on Ubuntu 17.04 as my home directory, in case it
matters--maybe this only happens in that setup.
git bisect says the issue is with this commit, which relates to the
error message.
commit 1f9f514e7c2ba41b0954d0141f99652f6a53a107
Author: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed Aug 2 01:53:46 2017 -0700
When renaming a file, ask only if EEXIST or ENOSYS
Thanks!
Ted
% git status
(clean tree)
% make distclean; ./autogen.sh all; ./configure --with-modules ; make -j10
...
GEN net/tramp-loaddefs.el
Source file ‘/home/tzz/source/emacs/emacs/lisp/emacs-lisp/map.el’ newer than byte-compiled file
Source file ‘/home/tzz/source/emacs/emacs/lisp/emacs-lisp/cl-lib.el’ newer than byte-compiled file
Source file ‘/home/tzz/source/emacs/emacs/lisp/emacs-lisp/gv.el’ newer than byte-compiled file
Renaming: Invalid argument, /home/tzz/source/emacs/emacs/lisp/net/tramp-loaddefs.el198334G4, /home/tzz/source/emacs/emacs/lisp/net/tramp-loaddefs.el
Makefile:424: recipe for target 'net/tramp-loaddefs.el' failed
make[2]: *** [net/tramp-loaddefs.el] Error 255
% git status
Untracked files:
admin/unidata/unidata-gen.elc198064G4
admin/unidata/uvs.elc198044G4
lisp/net/tramp-loaddefs.el198114G4
lisp/net/tramp-loaddefs.el198334G4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: strange build error today: "Renaming: Invalid argument"
2017-08-03 20:41 strange build error today: "Renaming: Invalid argument" Ted Zlatanov
@ 2017-08-03 20:57 ` Paul Eggert
2017-08-03 23:21 ` Paul Eggert
0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggert @ 2017-08-03 20:57 UTC (permalink / raw)
To: emacs-devel
On 08/03/2017 01:41 PM, Ted Zlatanov wrote:
> Renaming: Invalid argument, /home/tzz/source/emacs/emacs/lisp/net/tramp-loaddefs.el198334G4, /home/tzz/source/emacs/emacs/lisp/net/tramp-loaddefs.el
What is the output of 'uname -a' on your host? And what kind of file
system are you using?
Also, can you see which system calls were invoked and why the rename
failed? Please try this:
strace -f -o /tmp/trace make
and look near calls to 'renameat2' in /tmp/trace, especially syscalls
that fail with errno == EINVAL. On my platform (Fedora 26 x86-64, with
Linux kernel 4.11.11, ext4 file system), the relevant trace output looks
like the following:
14983 faccessat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el14983K04",
F_OK) = -1 ENOENT (No such file or directory)
14983 uname({sysname="Linux", nodename="Penguin.CS.UCLA.EDU", ...}) = 0
14983 getpid() = 14983
14983 symlink("eggert@Penguin.CS.UCLA.EDU.14983:1501671282",
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/.#tramp-loaddefs.el14983K04")
= 0
14983
open("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el14983K04",
O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 5
14983 write(5, ";;; tramp-loaddefs.el --- automa"..., 56329) = 56329
14983 close(5) = 0
14983 readlinkat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/.#tramp-loaddefs.el14983K04",
"eggert@Penguin.CS.UCLA.EDU.14983"..., 8193) = 43
14983 uname({sysname="Linux", nodename="Penguin.CS.UCLA.EDU", ...}) = 0
14983 getpid() = 14983
14983
unlink("/home/eggert/src/gnu/emacs/static-checking/lisp/net/.#tramp-loaddefs.el14983K04")
= 0
14983 newfstatat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
0x7fff0a7bb1a0, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
14983
stat("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
0x7fff0a7bb4a0) = -1 ENOENT (No such file or directory)
14983 renameat2(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el14983K04",
AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
RENAME_NOREPLACE) = 0
14983 readlinkat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/.#tramp-loaddefs.el",
"eggert@Penguin.CS.UCLA.EDU.14983"..., 8193) = 43
14983 uname({sysname="Linux", nodename="Penguin.CS.UCLA.EDU", ...}) = 0
14983 getpid() = 14983
14983
unlink("/home/eggert/src/gnu/emacs/static-checking/lisp/net/.#tramp-loaddefs.el")
= 0
14983
stat("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
{st_mode=S_IFREG|0644, st_size=56329, ...}) = 0
14983 getpid() = 14983
14983 faccessat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el14983kCk",
F_OK) = -1 ENOENT (No such file or directory)
14983 uname({sysname="Linux", nodename="Penguin.CS.UCLA.EDU", ...}) = 0
14983 getpid() = 14983
14983 symlink("eggert@Penguin.CS.UCLA.EDU.14983:1501671282",
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/.#tramp-loaddefs.el14983kCk")
= 0
14983
open("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el14983kCk",
O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 5
14983 write(5, ";;; tramp-loaddefs.el --- automa"..., 56329) = 56329
14983 close(5) = 0
14983 readlinkat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/.#tramp-loaddefs.el14983kCk",
"eggert@Penguin.CS.UCLA.EDU.14983"..., 8193) = 43
14983 uname({sysname="Linux", nodename="Penguin.CS.UCLA.EDU", ...}) = 0
14983 getpid() = 14983
14983
unlink("/home/eggert/src/gnu/emacs/static-checking/lisp/net/.#tramp-loaddefs.el14983kCk")
= 0
14983 newfstatat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
{st_mode=S_IFREG|0644, st_size=56329, ...}, AT_SYMLINK_NOFOLLOW) = 0
14983 readlinkat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
0x7fff0a7ba9c0, 1024) = -1 EINVAL (Invalid argument)
14983
stat("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
{st_mode=S_IFREG|0644, st_size=56329, ...}) = 0
14983
getxattr("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
"system.posix_acl_access", 0x7fff0a7bad00, 132) = -1 ENODATA (No data
available)
14983
stat("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
{st_mode=S_IFREG|0644, st_size=56329, ...}) = 0
14983
lgetxattr("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
"security.selinux", "unconfined_u:object_r:home_root_"..., 255) = 37
14983 access("/var/run/setrans/.setrans-unix", F_OK) = -1 ENOENT (No
such file or directory)
14983 futex(0x7f3db77154b0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
14983 faccessat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/", W_OK) = 0
14983 newfstatat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
{st_mode=S_IFREG|0644, st_size=56329, ...}, AT_SYMLINK_NOFOLLOW) = 0
14983 geteuid() = 1000
14983 getegid() = 1000
14983 newfstatat(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/",
{st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
14983 geteuid() = 1000
14983
stat("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el~",
{st_mode=S_IFREG|0644, st_size=56329, ...}) = 0
14983 renameat2(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el~",
RENAME_NOREPLACE) = -1 EEXIST (File exists)
14983
rename("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el~")
= 0
14983
stat("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
0x7fff0a7bb2c0) = -1 ENOENT (No such file or directory)
14983 renameat2(AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el14983kCk",
AT_FDCWD,
"/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
RENAME_NOREPLACE) = 0
14983
stat("/home/eggert/src/gnu/emacs/static-checking/lisp/net/tramp-loaddefs.el",
{st_mode=S_IFREG|0644, st_size=56329, ...}) = 0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: strange build error today: "Renaming: Invalid argument"
2017-08-03 20:57 ` Paul Eggert
@ 2017-08-03 23:21 ` Paul Eggert
2017-08-04 13:21 ` Ted Zlatanov
0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggert @ 2017-08-03 23:21 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 125 bytes --]
I managed to reproduce the bug on a RHEL 7 host with NFS, and installed the
attached patch to fix it. Please give it a try.
[-- Attachment #2: 0001-Port-recent-rename-changes-to-RHEL-7-NFS.patch --]
[-- Type: text/x-patch, Size: 2942 bytes --]
From ddc1ff58dec92a782b233d97a254fc41c1c887eb Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 3 Aug 2017 16:18:45 -0700
Subject: [PATCH] Port recent rename changes to RHEL 7 + NFS
Problem reported by Ted Zlatanov in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00082.html
* src/fileio.c (Frename_file): On RHEL 7 + NFS, renameat2 can fail
with errno == EINVAL when it is not supported. So treat that case
like errno == ENOSYS. Also, when ok_if_already_exists is neither
nil nor an integer, just call plain rename; this avoids an extra
syscall to renameat2 when the latter fails with errno == EINVAL or
ENOSYS or ENOENT.
---
src/fileio.c | 45 ++++++++++++++++++++++++++++++---------------
1 file changed, 30 insertions(+), 15 deletions(-)
diff --git a/src/fileio.c b/src/fileio.c
index 0264c9f..db760d9 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2344,23 +2344,38 @@ This is what happens in interactive use with M-x. */)
encoded_file = ENCODE_FILE (file);
encoded_newname = ENCODE_FILE (newname);
- if (renameat_noreplace (AT_FDCWD, SSDATA (encoded_file),
- AT_FDCWD, SSDATA (encoded_newname))
- == 0)
- return Qnil;
- int rename_errno = errno;
+ /* If the filesystem is case-insensitive and the file names are
+ identical but for the case, don't worry whether the destination
+ already exists: the caller simply wants to change the letter-case
+ of the file name. */
+ bool plain_rename
+ = ((!NILP (ok_if_already_exists) && !INTEGERP (ok_if_already_exists))
+ || (file_name_case_insensitive_p (SSDATA (encoded_file))
+ && ! NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname)))));
+
+ int rename_errno;
+ if (!plain_rename)
+ {
+ if (renameat_noreplace (AT_FDCWD, SSDATA (encoded_file),
+ AT_FDCWD, SSDATA (encoded_newname))
+ == 0)
+ return Qnil;
+
+ rename_errno = errno;
+ switch (rename_errno)
+ {
+ case EEXIST: case EINVAL: case ENOSYS:
+ barf_or_query_if_file_exists (newname, rename_errno == EEXIST,
+ "rename to it",
+ INTEGERP (ok_if_already_exists),
+ false);
+ plain_rename = true;
+ break;
+ }
+ }
- if (rename_errno == EEXIST || rename_errno == ENOSYS)
+ if (plain_rename)
{
- /* If the filesystem is case-insensitive and the file names are
- identical but for the case, don't ask for confirmation: they
- simply want to change the letter-case of the file name. */
- if ((NILP (ok_if_already_exists) || INTEGERP (ok_if_already_exists))
- && (! file_name_case_insensitive_p (SSDATA (encoded_file))
- || NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname)))))
- barf_or_query_if_file_exists (newname, rename_errno == EEXIST,
- "rename to it",
- INTEGERP (ok_if_already_exists), false);
if (rename (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0)
return Qnil;
rename_errno = errno;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: strange build error today: "Renaming: Invalid argument"
2017-08-03 23:21 ` Paul Eggert
@ 2017-08-04 13:21 ` Ted Zlatanov
0 siblings, 0 replies; 4+ messages in thread
From: Ted Zlatanov @ 2017-08-04 13:21 UTC (permalink / raw)
To: emacs-devel
On Thu, 3 Aug 2017 16:21:29 -0700 Paul Eggert <eggert@cs.ucla.edu> wrote:
PE> I managed to reproduce the bug on a RHEL 7 host with NFS, and installed the
PE> attached patch to fix it. Please give it a try.
Hi Paul,
I can confirm that the latest master fixes the renaming issue. I should
have opened a bug but wasn't sure it wasn't just me. Thanks for working
on this.
Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-04 13:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-03 20:41 strange build error today: "Renaming: Invalid argument" Ted Zlatanov
2017-08-03 20:57 ` Paul Eggert
2017-08-03 23:21 ` Paul Eggert
2017-08-04 13:21 ` Ted Zlatanov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.