[tz] Possible zic bug in far future calculations?

Gilmore Davidson gilmoreorless at gmail.com
Thu Dec 28 11:24:04 UTC 2023


I was compiling the 2023d release for the Moment Timezone JS library and noticed some oddities in the diff of the generated files.

A lot of tests are auto-generated from the data for each tzdb release, making sure the library correctly handles each transition defined in `zdump` output.
For 2023d, a handful of zones in North America added a lot more transition tests after the year 2400.
These transitions were apparently missing in earlier releases, and appear to have been fixed by commit 35c116b7 ("Fix zic bug with Palestine after 2075"), which makes sense.

But a strange case I noticed is specific to `America/Ciudad_Juarez`. In 2023c its overall zdump output ended at 2422, not 2499 like other zones.
In 2023d zdump does go to 2499, but there's now a weird set of transitions in 2422.

Compiling zic/zdump for 2023c and getting the data for 2421-2423:

$ /tmp/tz/2023c/git/zdump -V -c2421,2424 /tmp/tz/2023c/zic/America/Ciudad_Juarez
/tmp/tz/2023c/zic/America/Ciudad_Juarez  Sun Mar 14 08:59:59 2421 UT = Sun Mar 14 01:59:59 2421 MST isdst=0 gmtoff=-25200
/tmp/tz/2023c/zic/America/Ciudad_Juarez  Sun Mar 14 09:00:00 2421 UT = Sun Mar 14 03:00:00 2421 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023c/zic/America/Ciudad_Juarez  Sun Nov  7 07:59:59 2421 UT = Sun Nov  7 01:59:59 2421 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023c/zic/America/Ciudad_Juarez  Sun Nov  7 08:00:00 2421 UT = Sun Nov  7 01:00:00 2421 MST isdst=0 gmtoff=-25200
/tmp/tz/2023c/zic/America/Ciudad_Juarez  Sun Mar 13 08:59:59 2422 UT = Sun Mar 13 01:59:59 2422 MST isdst=0 gmtoff=-25200
/tmp/tz/2023c/zic/America/Ciudad_Juarez  Sun Mar 13 09:00:00 2422 UT = Sun Mar 13 03:00:00 2422 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023c/zic/America/Ciudad_Juarez  Sun Nov  6 07:59:59 2422 UT = Sun Nov  6 01:59:59 2422 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023c/zic/America/Ciudad_Juarez  Sun Nov  6 08:00:00 2422 UT = Sun Nov  6 01:00:00 2422 MST isdst=0 gmtoff=-25200

Doing the same for 2023d:

$ /tmp/tz/2023d/git/zdump -V -c2421,2424 /tmp/tz/2023d/zic/America/Ciudad_Juarez
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Mar 14 08:59:59 2421 UT = Sun Mar 14 01:59:59 2421 MST isdst=0 gmtoff=-25200
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Mar 14 09:00:00 2421 UT = Sun Mar 14 03:00:00 2421 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Nov  7 07:59:59 2421 UT = Sun Nov  7 01:59:59 2421 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Nov  7 08:00:00 2421 UT = Sun Nov  7 01:00:00 2421 MST isdst=0 gmtoff=-25200
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Mar 13 08:59:59 2422 UT = Sun Mar 13 01:59:59 2422 MST isdst=0 gmtoff=-25200
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Mar 13 09:00:00 2422 UT = Sun Mar 13 03:00:00 2422 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Nov  6 07:59:59 2422 UT = Sun Nov  6 01:59:59 2422 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Nov  6 08:00:00 2422 UT = Sun Nov  6 01:00:00 2422 MST isdst=0 gmtoff=-25200
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Nov  6 08:00:00 2422 UT = Sun Nov  6 01:00:00 2422 MST isdst=0 gmtoff=-25200
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Nov  6 08:00:01 2422 UT = Sun Nov  6 02:00:01 2422 CST isdst=0 gmtoff=-21600
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Wed Nov 30 05:59:59 2422 UT = Tue Nov 29 23:59:59 2422 CST isdst=0 gmtoff=-21600
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Wed Nov 30 06:00:00 2422 UT = Tue Nov 29 23:00:00 2422 MST isdst=0 gmtoff=-25200
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Mar 12 08:59:59 2423 UT = Sun Mar 12 01:59:59 2423 MST isdst=0 gmtoff=-25200
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Mar 12 09:00:00 2423 UT = Sun Mar 12 03:00:00 2423 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Nov  5 07:59:59 2423 UT = Sun Nov  5 01:59:59 2423 MDT isdst=1 gmtoff=-21600
/tmp/tz/2023d/zic/America/Ciudad_Juarez  Sun Nov  5 08:00:00 2423 UT = Sun Nov  5 01:00:00 2423 MST isdst=0 gmtoff=-25200

Note that consecutive seconds on Nov 6 2422 go MDT -> MST -> CST, then back to MST on Nov 30.

(For diagnostic purposes... I'm running these tests on macOS 14.2.1 with default `make` and `make install`, no extra flags.)

I don't particularly care about (or believe) the accuracy of the data that far in the future, but the wonky transitions make me think there's a bug lurking in zic that might affect other transitions at some point, if the conditions are right.

I found it interesting that the data previously cut off exactly 400 years after the zone's last defined "until" rule in `northamerica`.
Digging further, the other zones that had incomplete data follow the same pattern:

`America/Indiana/Petersberg` ended in 2407 (last defined "until" in 2007).
`America/Indiana/Vincennes` the same.
`America/North_Dakota/Belulah` ended in 2410 (last defined "until" in 2010).

These other zones don't appear to have the same consecutive transition problem (i.e. they're not buggy any more), but the 400 year pattern is telling.

Cheers,
Gil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mm.icann.org/pipermail/tz/attachments/20231228/d185889a/attachment.html>


More information about the tz mailing list