tzname[1] empty after tzset() with env TZ="UTC"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
django-mailman3 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
php8.2 (Ubuntu) |
Triaged
|
Undecided
|
Unassigned | ||
postgresql-15 (Ubuntu) |
Fix Committed
|
Undecided
|
Unassigned | ||
python-django (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
tzdata (Debian) |
Fix Released
|
Unknown
|
|||
tzdata (Ubuntu) |
Fix Released
|
Critical
|
Unassigned |
Bug Description
The following program prints different output when run with tzdata 2023c-7ubuntu1 from mantic, versus tzdata 2023c-8ubuntu1 from mantic-proposed:
root@mantic:~# cat bug.c
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int main(void) {
int r;
r = setenv("TZ", ":UTC", 1);
if (r < 0) {
}
tzset();
}
root@mantic:~# gcc bug.c
root@mantic:~# ./a.out
timezone = 0, daylight = 0
tzname[0] = UTC, tzname[1] = UTC
root@mantic:~# apt-cache policy tzdata
tzdata:
Installed: 2023c-7ubuntu1
Candidate: 2023c-7ubuntu1
Version table:
*** 2023c-7ubuntu1 500
500 http://
100 /var/lib/
If I install tzdata from mantic-proposed, I get different output:
root@mantic:~# vi /etc/apt/
root@mantic:~# apt update && apt install tzdata
Hit:1 http://
Hit:2 http://
Get:3 http://
Hit:4 http://
Hit:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Get:9 http://
Get:10 http://
Get:11 http://
Get:12 http://
Fetched 192 kB in 1s (324 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
72 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@mantic:~# apt install tzdata=
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libefiboot1 libefivar1
Use 'apt autoremove' to remove them.
The following packages will be upgraded:
tzdata
1 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.
Need to get 269 kB of archives.
After this operation, 142 kB disk space will be freed.
Get:1 http://
Fetched 269 kB in 0s (867 kB/s)
Preconfiguring packages ...
(Reading database ... 39935 files and directories currently installed.)
Preparing to unpack .../tzdata_
Unpacking tzdata (2023c-8ubuntu1) over (2023c-7ubuntu1) ...
Setting up tzdata (2023c-8ubuntu1) ...
Current default time zone: 'Etc/UTC'
Local time is now: Mon Aug 7 21:18:35 UTC 2023.
Universal Time is now: Mon Aug 7 21:18:35 UTC 2023.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
Scanning processes...
Scanning candidates...
Restarting services...
Service restarts being deferred:
systemctl restart systemd-
systemctl restart unattended-
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@mantic:~# ./a.out
timezone = 0, daylight = 0
tzname[0] = UTC, tzname[1] =
root@mantic:~# apt-cache policy tzdata-legacy
tzdata-legacy:
Installed: (none)
Candidate: 2023c-7ubuntu1
Version table:
2023c-8ubuntu1 100
100 http://
2023c-7ubuntu1 500
500 http://
In particular, note that tzname[1] (the name of the daylight zone) is empty, whereas it previously printed "UTC".
Changed in tzdata (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Critical |
Changed in tzdata (Ubuntu): | |
status: | Triaged → Fix Committed |
Changed in postgresql-15 (Ubuntu): | |
status: | New → Fix Committed |
Changed in php8.2 (Ubuntu): | |
status: | New → Triaged |
Changed in systemd (Ubuntu): | |
status: | New → Invalid |
Changed in tzdata (Debian): | |
status: | Unknown → Fix Released |
The program works again whenever tzdata-legacy is installed, but is this the intended behavior? This causes some tests to fail in systemd at build time, so systemd is currently FTBFS with mantic-proposed.