Closed greghogan closed 1 year ago
I assume we may not have a test-environment with a filesystem with 32 bit time stamps. Could you elaborate on your environment?
This is compiling on an Amazon Linux 2
EC2 instance with the default xfs
filesystem. Running Linux 5.10
but big timestamps are not enabled.
$ mount | grep xfs
/dev/nvme0n1p1 on / type xfs (rw,noatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)
$ xfs_info / | grep bigtime
$ uname -r
5.10.130-118.517.amzn2.x86_64
$ sudo /bin/touch -d 22000101 /file && /bin/stat /file && sudo rm /file
File: ‘/file’
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 10301h/66305d Inode: 2572269 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2038-01-19 03:14:07.000000000 +0000
Modify: 2038-01-19 03:14:07.000000000 +0000
Change: 2022-11-08 18:39:16.840670282 +0000
Birth: -
https://github.com/bloomberg/bde/blob/main/groups/bdl/bdls/bdls_filesystemutil.t.cpp#L3458 appears meant to handle systems which do not provide 32 bits for their time stamps. I would assume though that the logic being performed here makes compile-time assumption (based on the build environment) about the range of available offsets. I would assume this may be a runtime property based on the file location.
internal tracking 170731132
Thank you Greg for pointing this out. We are setting up an environment which will enable us to reproduce this (and ensure any fix is suitably tested prior to release), and will let you know how this progresses.
The fix for this has been merged. Should be available once the main branch syncs.
Commit id: 1925c93e7bf8bca1ba4cade05b09cbff07561fd7
bde 3.110.0.3 bde-tools 3.110.0.0
My Linux filesystem only supports 32-bit timestamps (max-year 2038) so the year 2200 tests are off by 59150 days ~= 162 years.
It is unclear to me why
TestUtil_UnixImpUtil::getMinFileTime()
returns either aDateTime
ofbsl::numeric_limits<time_t>::max()
seconds ormaxDatetime(9999, 12, 31, 23, 59, 59, 999, 999)
seemingly without checking that the filesystem supports 64-bit timestamps (which is not guaranteed by having 64-bitoff_t
).