Subject: Re: Bug#421491: Possible fileutils regression in debian 4

From: "G.P. Walker BEng (Hons) MIET EngTech" <[email-masked]>
Date: Sun, 29 Apr 2007 21:47:52 +0100 (GMT+01:00)

>Please try using 'strace' to trace the system calls and show the
>results of them.
>
>  strace -o cp-a.strace.out cp -a SRC DST
>
>I believe the output of that should be sufficiently small and should
>contain the information needed to determine where the problem exists.

Here is the output of the strace log for my etch system:

execve("/bin/cp", ["cp", "-a", "zdiff", "/mnt/ad1/"], [/* 14 vars */]) 
= 0
uname({sys="Linux", node="debian-etch-virtual", ...}) = 0
brk(0)                                  = 0x8057000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f87000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or 
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=10331, ...}) = 0
mmap2(NULL, 10331, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f84000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/libacl.so.1", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\23"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=22156, ...}) = 0
mmap2(NULL, 20980, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0xb7f7e000
mmap2(0xb7f83000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5) = 0xb7f83000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/libselinux.so.1", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P8\0\000"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=79368, ...}) = 0
mmap2(NULL, 84884, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0xb7f69000
mmap2(0xb7f7c000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12) = 0xb7f7c000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240O\1"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1241392, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f68000
mmap2(NULL, 1247388, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 
3, 0) = 0xb7e37000
mmap2(0xb7f5e000, 28672, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x127) = 0xb7f5e000
mmap2(0xb7f65000, 10396, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f65000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/libattr.so.1", O_RDONLY)     = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\f\0\000"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=12840, ...}) = 0
mmap2(NULL, 15796, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0xb7e33000
mmap2(0xb7e36000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb7e36000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\f\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9592, ...}) = 0
mmap2(NULL, 12404, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0xb7e2f000
mmap2(0xb7e31000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7e31000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/libsepol.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0200\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=219824, ...}) = 0
mmap2(NULL, 265152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0xb7dee000
mmap2(0xb7e24000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x35) = 0xb7e24000
mmap2(0xb7e25000, 39872, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7e25000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7ded000
mprotect(0xb7f5e000, 20480, PROT_READ)  = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7ded9a0, limit:
1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, 
seg_not_present:0, useable:1}) = 0
munmap(0xb7f84000, 10331)               = 0
access("/etc/selinux/", F_OK)           = -1 ENOENT (No such file or 
directory)
brk(0)                                  = 0x8057000
brk(0x8078000)                          = 0x8078000
open("/proc/mounts", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb7f86000
read(3, "rootfs / rootfs rw 0 0\nnone /sys"..., 1024) = 576
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0xb7f86000, 4096)                = 0
open("/proc/filesystems", O_RDONLY|O_LARGEFILE) = 3
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 4095) = 240
close(3)                                = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1209088, ...}) = 0
mmap2(NULL, 1209088, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7cc5000
close(3)                                = 0
geteuid32()                             = 0
stat64("/mnt/ad1/", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
lstat64("zdiff", {st_mode=S_IFREG|0755, st_size=1974, ...}) = 0
lstat64("/mnt/ad1/zdiff", 0xbfceff34)   = -1 ENOENT (No such file or 
directory)
open("zdiff", O_RDONLY|O_LARGEFILE)     = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=1974, ...}) = 0
open("/mnt/ad1/zdiff", O_WRONLY|O_CREAT|O_LARGEFILE, 0100755) = 4
fstat64(4, {st_mode=S_IFREG|0755, st_size=0, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0755, st_size=1974, ...}) = 0
read(3, "#!/bin/sh\n# sh is buggy on RS/60"..., 16384) = 1974
write(4, "#!/bin/sh\n# sh is buggy on RS/60"..., 1974) = 1974
read(3, "", 16384)                      = 0
utimes("/proc/self/fd/4", {1177876734, 0}) = 0
fchown32(4, 0, 0)                       = 0
getxattr("zdiff", "system.posix_acl_access", 0xbfceab20, 132) = -1 
EOPNOTSUPP (Operation not supported)
setxattr("/mnt/ad1/zdiff", "system.posix_acl_access", 
"\x02\x00\x00\x00\x01\x00\x07\x00\xff\xff\xff\xff\x04\x00\x05\x00\xff\xff\xff\xff 
\x00\x05\x00\xff\xff\xff\xff", 28, 0) = -1 EOPNOTSUPP (Operation not 
supported)
chmod("/mnt/ad1/zdiff", 0100755)        = 0
close(4)                                = 0
close(3)                                = 0
getxattr("zdiff", "system.posix_acl_access", 0xbfcefc90, 132) = -1 
EOPNOTSUPP (Operation not supported)
setxattr("/mnt/ad1/zdiff", "system.posix_acl_access", 
"\x02\x00\x00\x00\x01\x00\x07\x00\xff\xff\xff\xff\x04\x00\x05\x00\xff\xff\xff\xff 
\x00\x05\x00\xff\xff\xff\xff", 28, 0) = -1 EOPNOTSUPP (Operation not 
supported)
chmod("/mnt/ad1/zdiff", 0100755)        = 0
close(1)                                = 0
exit_group(0)                           = ?

And  here us the output from my woody system:

execve("/bin/cp", ["cp", "-a", "touch", "/mnt/ad1/"], [/* 16 vars */]) 
= 0
uname({sys="Linux", node="virtual-debian-vaio", ...}) = 0
brk(0)                                  = 0x8056000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0) = 0xb7f75000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or 
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=42861, ...}) = 0
old_mmap(NULL, 42861, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f6a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/libacl.so.1", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\24"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=22336, ...}) = 0
old_mmap(NULL, 25412, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
0xb7f63000
old_mmap(0xb7f69000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED, 3, 0x5000) = 0xb7f69000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`Z\1\000"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1254660, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0) = 0xb7f62000
old_mmap(NULL, 1264972, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
0xb7e2d000
old_mmap(0xb7f57000, 36864, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED, 3, 0x129000) = 0xb7f57000
old_mmap(0xb7f60000, 7500, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f60000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/libattr.so.1", O_RDONLY)     = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\r\0"..., 
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=10824, ...}) = 0
old_mmap(NULL, 13892, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 
0xb7e29000
old_mmap(0xb7e2c000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0xb7e2c000
close(3)                                = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f62b80, limit:
1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, 
seg_not_present:0, useable:1}) = 0
munmap(0xb7f6a000, 42861)               = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=290448, ...}) = 0
mmap2(NULL, 290448, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7de2000
close(3)                                = 0
brk(0)                                  = 0x8056000
brk(0x8077000)                          = 0x8077000
brk(0)                                  = 0x8077000
geteuid32()                             = 0
lstat64("/mnt/ad1/", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
stat64("/mnt/ad1/", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
lstat64("touch", {st_mode=S_IFREG|0755, st_size=30360, ...}) = 0
lstat64("/mnt/ad1/touch", {st_mode=S_IFREG|0755, st_size=30360, ...}) 
= 0
open("touch", O_RDONLY|O_LARGEFILE)     = 3
fstat64(3, {st_mode=S_IFREG|0755, st_size=30360, ...}) = 0
open("/mnt/ad1/touch", O_WRONLY|O_TRUNC|O_LARGEFILE) = 4
fstat64(4, {st_mode=S_IFREG|0755, st_size=0, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0755, st_size=30360, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\2\0\3\0\1\0\0\0 \216\4"..., 
16384) = 16384
write(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\2\0\3\0\1\0\0\0 \216\4"..., 
16384) = 16384
read(3, "U\f9U\324s\6\213M\10\306\1\'\307E\324\1\0\0\0\307E\320"..., 
16384) = 13976
write(4, "U\f9U\324s\6\213M\10\306\1\'\307E\324\1\0\0\0\307E\320"..., 
13976) = 13976
read(3, "", 16384)                      = 0
close(4)                                = 0
close(3)                                = 0
utimes("/mnt/ad1/touch", {1176147960, 0}) = 0
getxattr("touch", "system.posix_acl_access", 0xbfbb32e0, 132) = -1 
EOPNOTSUPP (Operation not supported)
setxattr("/mnt/ad1/touch", "system.posix_acl_access", 
"\x02\x00\x00\x00\x01\x00\x07\x00\xff\xff\xff\xff\x04\x00\x05\x00\xff\xff\xff\xff 
\x00\x05\x00\xff\xff\xff\xff", 28, ) = -1 EOPNOTSUPP (Operation not 
supported)
chmod("/mnt/ad1/touch", 0100755)        = 0
exit_group(0)                           = ?

>
>> If the files are copied using ssh with switches to preserve dates,
>> the files do preserve the dates.  This leads me to believe the 
issue
>> lies within the cp application or the fileutils/coreutils package.
>
>Interesting.  Given your present information I would agree.  But
>because the libc and the kernel are both involved and both are also
>different between the systems and because I have seen related issues
>there I am suspicious of them.  There are multiple different ways to
>obtain and set file timestamp information.  It is possible that scp 
is
>using a different system call than cp and therefore different 
behavior
>results.
>Bob

___________________________________________________________

Tiscali Broadband only £9.99 a month for your first 3 months! http://www.tiscali.co.uk/products/broadband/