Ubuntu's groff ignores TZ (but upstream works)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
groff (Ubuntu) |
Fix Released
|
High
|
Colin Watson |
Bug Description
Ubuntu 20.04.1 LTS
groff's date & time (visible in variable \n[hours] for example) are always in UTC, not the local time. The TZ environment variable is ignored.
The upstream version doesn't have this bug; it honors TZ as it should. I downloaded and built from upstream source the exact same version of groff that the Ubuntu package claims to contain, and it works. But the Ubuntu binary does not work in this respect.
dpkg-query -l groff says: 1.22.4-4build1 amd64
Upstream source code is at http://
STEPS TO REPRODUCE:
1. Run the following script
#!/bin/sh
#GROFF=
GROFF=/
echo "Using $GROFF"
for varlist in \
'PATH=
'PATH=
'PATH=
'PATH=
; do
echo "------
eval "env -i $varlist /bin/sh" <<SHELLEOF
#(set -x; env)
echo "TZ is \${TZ:-(unset)}"
echo -n "date says: "; date +'%Y-%m-%d %H:%M:%S'
$GROFF <<'GEND' 2>&1 >/dev/null
.tm groff says: \n[year]
GEND
SHELLEOF
done
***
Here is output on my system (notice that \n[hours] is always in UTC regardless of TZ):
Using /usr/bin/groff
-------
TZ is (unset)
date says: 2020-12-15 16:54:38
groff says: 2020-12-16 0:54:38
-------
TZ is UTC
date says: 2020-12-16 00:54:38
groff says: 2020-12-16 0:54:38
-------
TZ is America/New_York
date says: 2020-12-15 19:54:38
groff says: 2020-12-16 0:54:38
-------
TZ is America/Los_Angeles
date says: 2020-12-15 16:54:38
groff says: 2020-12-16 0:54:38
***
Here is output using groff built from upstream source:
Using /home/jima/
-------
TZ is (unset)
date says: 2020-12-15 16:55:05
groff says: 2020-12-15 16:55:5
-------
TZ is UTC
date says: 2020-12-16 00:55:05
groff says: 2020-12-16 0:55:5
-------
TZ is America/New_York
date says: 2020-12-15 19:55:05
groff says: 2020-12-15 19:55:5
-------
TZ is America/Los_Angeles
date says: 2020-12-15 16:55:05
groff says: 2020-12-15 16:55:5
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: groff 1.22.4-4build1
ProcVersionSign
Uname: Linux 5.4.0-54-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Tue Dec 15 16:40:41 2020
InstallationDate: Installed on 2020-03-24 (266 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
SourcePackage: groff
UpgradeStatus: Upgraded to focal on 2020-05-16 (213 days ago)
Changed in groff (Ubuntu): | |
importance: | Undecided → High |
status: | Confirmed → In Progress |
assignee: | nobody → Colin Watson (cjwatson) |
It is debian/ display- utc-times. patch
Subject: Always use UTC times for display
Using localtime is problematic for reproducible builds. For now, always
use UTC times (gmtime etc.) for display. (Note that this changes the
semantics of \n[hours] etc., so may need further work.)