#1014622 coreutils: du -S breaks --time output in two different ways; du -c --time always broken

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2022-07-09 01:54:04 UTC
Severity:
normal
#1014622#5
Date:
2022-07-09 01:50:09 UTC
From:
To:
Dear Maintainer,

A few thinkers for your consideration :)

Thinker 1:
Given:
-- >8 --
$ find aac/a -exec stat {} +
  File: aac/a
  Size: 3               Blocks: 18         IO Block: 512    directory
Device: 31h/49d Inode: 8186        Links: 3
Access: (0755/drwxr-xr-x)  Uid: ( 1000/nabijaczleweli)   Gid: (  100/   users)
Access: 2022-07-08 04:06:27.227494503 +0200
Modify: -090-03-27 05:50:40.000000000 +0124
Change: 2022-07-06 05:10:50.155554464 +0200
 Birth: 2021-10-08 01:15:59.018743238 +0200
  File: aac/a/b
  Size: 4               Blocks: 18         IO Block: 512    directory
Device: 31h/49d Inode: 8188        Links: 3
Access: (0755/drwxr-xr-x)  Uid: ( 1000/nabijaczleweli)   Gid: (  100/   users)
Access: 2022-07-08 04:06:27.227494503 +0200
Modify: 2021-09-17 16:00:06.000000000 +0200
Change: 2022-07-03 19:38:19.529159941 +0200
 Birth: 2021-10-08 01:15:59.018743238 +0200
  File: aac/a/b/q
  Size: 0               Blocks: 2          IO Block: 512    regular empty file
Device: 31h/49d Inode: 65962       Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/nabijaczleweli)   Gid: (  100/   users)
Access: 2022-06-25 03:36:39.269834666 +0200
Modify: 2021-09-17 15:30:30.000000000 +0200
Change: 2022-07-03 19:38:19.529159941 +0200
 Birth: 2021-10-08 01:18:19.648788144 +0200
  File: aac/a/b/c
  Size: 3               Blocks: 18         IO Block: 512    directory
Device: 31h/49d Inode: 8190        Links: 3
Access: (0755/drwxr-xr-x)  Uid: ( 1000/nabijaczleweli)   Gid: (  100/   users)
Access: 2022-07-08 04:06:27.227494503 +0200
Modify: 2021-09-17 16:00:06.000000000 +0200
Change: 2022-07-03 19:38:19.529159941 +0200
 Birth: 2021-10-08 01:15:59.018743238 +0200
  File: aac/a/b/c/d
  Size: 3               Blocks: 18         IO Block: 512    directory
Device: 31h/49d Inode: 8192        Links: 3
Access: (0755/drwxr-xr-x)  Uid: ( 1000/nabijaczleweli)   Gid: (  100/   users)
Access: 2022-07-08 04:06:27.227494503 +0200
Modify: 2021-09-17 16:00:06.000000000 +0200
Change: 2022-07-03 19:38:19.529159941 +0200
 Birth: 2021-10-08 01:15:59.018743238 +0200
  File: aac/a/b/c/d/e
  Size: 2               Blocks: 18         IO Block: 512    directory
Device: 31h/49d Inode: 8194        Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/nabijaczleweli)   Gid: (  100/   users)
Access: 2022-07-08 04:06:27.227494503 +0200
Modify: 2021-09-17 16:00:06.000000000 +0200
Change: 2022-07-03 19:38:19.529159941 +0200
 Birth: 2021-10-08 01:15:59.018743238 +0200
-- >8 --

Why is (extraneous output removed)
-- >8 --
$ TZ=UTC0 TIME_STYLE=full-iso du  aac/  -t2k -c  --exclude=cs_CZ* -a -LS --time
18      2021-09-17 14:00:06.000000000 +0000     aac/a/b/c/d/e
18      2021-09-17 14:00:06.000000000 +0000     aac/a/b/c/d
18      2021-09-17 14:00:06.000000000 +0000     aac/a/b/c
20      2021-09-17 14:00:06.000000000 +0000     aac/a/b
18      -090-03-27 04:26:40.000000000 +0000     aac/a
-- >8 --
if 2021 > -90?


Thinker 2:
Given the same tree as above, why is
-- >8 --
$ TZ=UTC0 TIME_STYLE=+%s du  aac/a  -t2k -c  --exclude=cs_CZ* -a  -LS --time
18      1631887206      aac/a/b/c/d/e
18      1631887206      aac/a/b/c/d
18      1631887206      aac/a/b/c
20      1631887206      aac/a/b
18      0       aac/a
92      1631887206      total
-- >8 --
???


Thinker 3:
Given the same tree as above, what in MEKHANE's name is happening in:
-- >8 --
$ TZ=UTC0 TIME_STYLE=+%s du  aac/a  --exclude=b -c --time
18      -65000000000    aac/a
18      0       total
-- >8 --
?


Thinker 1 could be explained by a documentation bug; du(1) says
       -S, --separate-dirs
              for directories do not include size of subdirectories
but maybe it means "do not include size or time of subdirectories"
since adding a file under aac/a dated for year 4000 does make aac/a be
in the year 4000.


Thinker 2 is very obviously wrong. Someone forgot they had time before
the seventies. 0 clue how that happens, though, unless du does a max()
over --time.. with itself but initialised to 0? Huh?


Thinker 3 is, well, the same, but less inexplicable.


наб