tzdata-2024b-0ubuntu0.24.04 makes std::chrono unusable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-14 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Focal |
Confirmed
|
Undecided
|
Unassigned | ||
Jammy |
Confirmed
|
Undecided
|
Unassigned | ||
Noble |
Confirmed
|
Undecided
|
Unassigned | ||
Oracular |
Confirmed
|
Undecided
|
Unassigned | ||
tzdata (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Noble |
Fix Released
|
Critical
|
Unassigned | ||
Oracular |
Fix Released
|
Undecided
|
Unassigned | ||
waybar (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Focal |
Confirmed
|
Undecided
|
Unassigned | ||
Jammy |
Confirmed
|
Undecided
|
Unassigned | ||
Noble |
Confirmed
|
Undecided
|
Unassigned | ||
Oracular |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
The latest tzdata SRU[1] included a change[2] in the main data form:
The main source files' time zone abbreviations now use %z,
supported by zic since release 2015f and used in vanguard form
since release 2022b. For example, America/Sao_Paulo now contains
the zone continuation line "-3:00 Brazil %z", which is less error
prone than the old "-3:00 Brazil -03/-02". This does not change
the represented data: the generated TZif files are unchanged.
Rearguard form still avoids %z, to support obsolescent parsers.
Turns out the standard c++ library in at least oracular and noble fail to parse that, resulting in a much small list of available timezones, or even crashes[3].
The c++ fix for that is in [4]. That might be eventually SRUed, but at the moment it's quicker to adjust tzdata than the c++ library. Also, there might be other parsers in the supported Ubuntu releases that are also affected, and just haven't been noticed yet.
1. https:/
2. https:/
3. https:/
4. https:/
[ Test Plan ]
This update includes a new DEP8 test that checks specifically for this bug. Therefore, the test plan is to observe that the full suite of autopkgtests is run and that it passed.
For jammy and focal, which do not contain the c++ library function that is failing, build this small C++ app in *NOBLE*:
#include <chrono>
#include <iostream>
int main() {
for (const auto & time_zone : std::chrono:
std::cout << time_zone.name() << std::endl;
}
}
Build and link statically, like so (assuming the file is called test.cpp):
g++ -std=c++20 -o test test.cpp -static
Then copy the resulting binary ("test") to the jammy and focal systems under test.
An affected system will show just two timezones:
$ ~/test
Etc/GMT
Etc/UTC
Whereas a fixed system will show hundreds.
[ Where problems could occur ]
All software that use tzdata could be affected by this update. There is probably at least one implementation in each programming language for reading the timezone data. The update could trigger parser bugs.
The autopkgtest will cover Python's zoneinfo and now C++ std::chrono.
[ Original Description ]
inalling tzdata in version 2024b-0ubuntu0.
code:
for (const auto & time_zone : std::chrono:
{
std::cout << time_zone.name() << std::endl;
}
output:
Etc/GMT
Etc/UTC
Related branches
- Andreas Hasenack: Approve
-
Diff: 183 lines (+96/-13)5 files modifieddebian/changelog (+9/-0)
debian/patches/Correct-timezone-symlinks-when-using-BACKWARD-backward-PA.patch (+14/-12)
debian/rules (+1/-1)
debian/tests/chrono (+68/-0)
debian/tests/control (+4/-0)
tags: | added: regression-update |
no longer affects: | zoneinfo |
Changed in tzdata (Ubuntu Noble): | |
milestone: | none → ubuntu-24.04.2 |
importance: | Undecided → High |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in tzdata (Ubuntu): | |
status: | Triaged → Fix Released |
corresponding fix exists: https:/ /gcc.gnu. org/bugzilla/ show_bug. cgi?id= 116657
but the mentioned versions are not yet available on ubuntu