Subject: Re: bug#46835: Fwd: Debian Bug 983706: gzip FTBFS on mips64el: FAIL: timestamp

From: Milan Kupcevic <[email-masked]>
Date: Fri, 5 Mar 2021 23:29:17 -0500

On 3/5/21 3:22 PM, Paul Eggert wrote:
> On 2/28/21 11:59 AM, Milan Kupcevic wrote:
>> A couple of timestamp tests are failing on mips64el. Please let me know
>> if you need more info.
> 
> What happens if you run the following shell commands, using the
> just-built gzip? What gzip.tr file is generated?
> 
> TZ=UTC0
> export TZ
> rm -f in in.gz
> touch -t 190101010000 in
> strace -v -o gzip.tr ./gzip in
> 
> The key part will be what is in the last few lines of gzip.tr when gzip
> looks at the file "in". Here's how gzip.tr ends on my Ubuntu 20.10 ext4
> system:
> 
[...]>
> 
> Perhaps the timestamps are somehow messed up on your platform, in which
> case you need to investigate why fstat is returning incorrect timestamps
> for the input file.
> 
> 
> 

Hi Paul,

"touch -t 190101010000 in" yields:

...
openat(AT_FDCWD, "/lib/mips64el-linux-gnuabi64/libc.so.6",
O_RDONLY|O_CLOEXEC) = 3
...
openat(AT_FDCWD, ".", O_RDONLY|O_DIRECTORY) = 3
openat(3, "in", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW) = 4
fstat(4, {st_dev=makedev(0xfe, 0x1), st_ino=7633726,
st_mode=S_IFREG|0644, st_nlink=1, st_uid=3363, st_gid=3363,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=2117514496 /*
2037-02-06T06:28:16+0000 */, st_atime_nsec=0, st_mtime=2117514496 /*
2037-02-06T06:28:16+0000 */, st_mtime_nsec=0, st_ctime=1615000963 /*
2021-03-06T03:22:43.248981507+0000 */, st_ctime_nsec=248981507}) = 0
brk(NULL)                               = 0xaaaf339000
brk(0xaaaf35a000)                       = 0xaaaf35a000
rt_sigprocmask(SIG_BLOCK, [HUP INT PIPE TERM XCPU XFSZ], [], 16) = 0
openat(3, "in.gz", O_WRONLY|O_CREAT|O_EXCL, 0600) = 5
rt_sigprocmask(SIG_SETMASK, [], NULL, 16) = 0
read(4, "", 65536)                      = 0
write(5, "\37\213\10\10\0\2656~\0\3in\0\3\0\0\0\0\0\0\0\0\0", 23) = 23
close(4)                                = 0
utimensat(5, NULL, [{tv_sec=2117514496, tv_nsec=0} /*
2037-02-06T06:28:16+0000 */, {tv_sec=2117514496, tv_nsec=0} /*
2037-02-06T06:28:16+0000 */], 0) = 0
fchown(5, -1, 3363)                     = 0
fchmod(5, 0644)                         = 0
fchown(5, 3363, -1)                     = 0
close(5)                                = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT PIPE TERM XCPU XFSZ], [], 16) = 0
unlinkat(3, "in", 0)                    = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 16) = 0
exit_group(0)                           = ?
+++ exited with 0 +++

And this is what happens with "touch -t 196912312359.59 in":

...
openat(AT_FDCWD, ".", O_RDONLY|O_DIRECTORY) = 3
openat(3, "in", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW) = 4
fstat(4, {st_dev=makedev(0xfe, 0x1), st_ino=7633726,
st_mode=S_IFREG|0644, st_nlink=1, st_uid=3363, st_gid=3363,
st_blksize=4096, st_blocks=0, st_size=0, st_atime=-1 /*
1969-12-31T23:59:59+0000 */, st_atime_nsec=0, st_mtime=-1 /*
1969-12-31T23:59:59+0000 */, st_mtime_nsec=0, st_ctime=1615003205 /*
2021-03-06T04:00:05.879666767+0000 */, st_ctime_nsec=879666767}) = 0
brk(NULL)                               = 0xaab194d000
brk(0xaab196e000)                       = 0xaab196e000
rt_sigprocmask(SIG_BLOCK, [HUP INT PIPE TERM XCPU XFSZ], [], 16) = 0
openat(3, "in.gz", O_WRONLY|O_CREAT|O_EXCL, 0600) = 5
rt_sigprocmask(SIG_SETMASK, [], NULL, 16) = 0
read(4, "", 65536)                      = 0
write(5, "\37\213\10\10\377\377\377\377\0\3in\0\3\0\0\0\0\0\0\0\0\0",
23) = 23
close(4)                                = 0
utimensat(5, NULL, [{tv_sec=4294967295, tv_nsec=0} /*
2106-02-07T06:28:15+0000 */, {tv_sec=4294967295, tv_nsec=0} /*
2106-02-07T06:28:15+0000 */], 0) = 0
fchown(5, -1, 3363)                     = 0
fchmod(5, 0644)                         = 0
fchown(5, 3363, -1)                     = 0
close(5)                                = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT PIPE TERM XCPU XFSZ], [], 16) = 0
unlinkat(3, "in", 0)                    = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 16) = 0
exit_group(0)                           = ?
+++ exited with 0 +++

Milan