coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: apparently non-spurious tests/misc/xattr failure with coreutils 8.23


From: Nick Alcock
Subject: Re: apparently non-spurious tests/misc/xattr failure with coreutils 8.23
Date: Fri, 03 Oct 2014 12:42:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

On 2 Oct 2014, Pádraig Brady stated:

> On 10/02/2014 04:59 PM, Nick Alcock wrote:
>> Here's the FAIL output. (Note that despite the name,
>> /usr/local/share/compiler-nfs is not nfs-mounted, but is an
>> xattr-capable ext4 filesystem which I pointed the testsuite at after
>> getting a similar failure on tmpfs.)
>> 
>> This is with kernel 3.16.3 and libattr current as of commit
>> 55f39ef1ddec924d746d96cbe5bdc1030eeff92b (which is still the trunk
>> head). Looking at the first failure, it looks like xattrs simply aren't
>> being properly preserved by cp, even though configure spotted it and cp
>> is linked against libattr:
>> 
>> spindle 1473 /usr/src/coreutils% eu-readelf -a x86_64-spindle/src/cp | grep 
>> NEEDED
>>   NEEDED            Shared library: [libacl.so.1]
>>   NEEDED            Shared library: [libattr.so.1]
>>   NEEDED            Shared library: [libc.so.6]
>
> So USE_XATTR is defined in lib/config.h ?

Yes.

> If so can you add some instrumentation to copy_attr() in src/copy.c
> as that essentially calls out to libattr to do the copy.

Sounds like a plan.

Hm. Instrumenting copy_attr_error() and copy_attr_allerror() to printf()
everything they get, and instrumenting the error points in the test
script to note when they fail and cat the failing output, I see multiple
failures, every single one unreported by libattr's error reporting, this
being the first:

+ setfattr -n user.foo -v bar a
+ getfattr -d a
+ grep -F 'user.foo="bar"' out_a
user.foo="bar"
+ cp a b
+ getfattr -d b
+ grep -F 'user.foo="bar"' out_b
+ cp --preserve=xattr a b
copying fd 3 to 4
ret: 0
+ getfattr -d b
+ grep -F 'user.foo="bar"' out_b
+ fail=1
+ echo p2
p2
+ cat out_b
+ cp --preserve=all a c

'p2' was the first cp --preserve=xattr test. They all fail the same way.

stracing the cp shows:

+ strace cp --preserve=xattr a b
execve("/usr/src/coreutils/x86_64-spindle/./src/cp", ["cp", "--preserve=xattr", 
"a", "b"], [/* 113 vars */]) = 0
brk(0)                                  = 0x229f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f7e1f2ca000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=228361, ...}) = 0
mmap(NULL, 228361, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7e1f292000
close(3)                                = 0
open("/lib/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340E\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=50007, ...}) = 0
mmap(NULL, 2138752, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f7e1eea1000
mprotect(0x7f7e1eeab000, 2093056, PROT_NONE) = 0
mmap(0x7f7e1f0aa000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7f7e1f0aa000
close(3)                                = 0
open("/lib/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\26\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=22613, ...}) = 0
mmap(NULL, 2113896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f7e1ec9c000
mprotect(0x7f7e1eca0000, 2093056, PROT_NONE) = 0
mmap(0x7f7e1ee9f000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f7e1ee9f000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\35\2\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2041843, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f7e1f291000
mmap(NULL, 3841728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f7e1e8f2000
mprotect(0x7f7e1ea92000, 2097152, PROT_NONE) = 0
mmap(0x7f7e1ec92000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a0000) = 0x7f7e1ec92000
mmap(0x7f7e1ec98000, 16064, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f7e1ec98000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f7e1f290000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f7e1f28f000
arch_prctl(ARCH_SET_FS, 0x7f7e1f290700) = 0
mprotect(0x7f7e1ec92000, 16384, PROT_READ) = 0
mprotect(0x7f7e1ee9f000, 4096, PROT_READ) = 0
mprotect(0x7f7e1f0aa000, 4096, PROT_READ) = 0
mprotect(0x61e000, 4096, PROT_READ)     = 0
mprotect(0x7f7e1f2cb000, 4096, PROT_READ) = 0
munmap(0x7f7e1f292000, 228361)          = 0
brk(0)                                  = 0x229f000
brk(0x22c0000)                          = 0x22c0000
geteuid()                               = 99
stat("b", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("a", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("b", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
open("a", O_RDONLY)                     = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
open("b", O_WRONLY|O_TRUNC)             = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fadvise64(3, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
mmap(NULL, 139264, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f7e1f2a8000
read(3, "", 131072)                     = 0
write(2, "copying fd 3 to 4\n", 18copying fd 3 to 4
)     = 18
write(2, "ret: 0\n", 7ret: 0
)                 = 7
close(4)                                = 0
close(3)                                = 0
munmap(0x7f7e1f2a8000, 139264)          = 0
lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++

No xattr syscalls at all.

I'll be digging into libattr next. Looks like it's not doing what it was
asked to do... and coreutils's testsuite was the first thing to spot it.
You can tell I don't use xattrs much :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]