NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/60715: NetBSD 11.0 zic generates invalid TZif files for western Canada



>Number:         60715
>Category:       bin
>Synopsis:       NetBSD 11.0 zic generates invalid TZif files for western Canada
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 11 00:40:00 +0000 2026
>Originator:     Paul Eggert
>Release:        11.0
>Organization:
UCLA Computer Science
>Environment:
NetBSD netbsd11 11.0 NetBSD 11.0 (GENERIC) #0: Thu Jul 30 15:23:12 UTC 2026  mkrepo%mkrepo.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
NetBSD 11 has zic from tzcode 2025b, which unfortunately by default generates incorrect TZif files for the America/Vancouver and America/Edmonton zones in tzdata 2026c. The problem does not exist in NetBSD's files /usr/share/zoneinfo/America/Vancouver and /usr/share/zoneinfo/America/Edmonton because these files are built with "zic -b fat", but it does exist if you use plain 'zic' to compile from zic input to binary output files.

This problem is documented as follows in bleeding-edge tzcode NEWS:

    This zic fix is needed for the temporary hack (mentioned above)
    that works around the Canadian timekeeping bug in Unicode CLDR.
    Without the fix, the temporary hack causes zic versions 2023d
    through 2026a, in their default mode that generates slim output,
    to generate a TZif file that violates Internet RFC 9636 §3.3.
    The buggy file in turn causes some TZif readers, including tzcode
    itself, to ignore America/Vancouver?s 2026-11-01 02:00 transition
    from PDT (tm_isdst=1) to MST (tm_isdst=0).  Although the buggy
    file does not cause any known TZif reader to mishandle UT offsets,
    caution is advised when using zic 2023d through 2026a to compile
    data from more-recent tz releases.  To work around this problem
    when using these older zic versions, use ?zic -b fat?.

My apologies for introducing the bug into tzcode 2023a via the patch ?Fix zic bug with Palestine after 2075? (tz commit 35c116b7536a36c43eb7cd36bff71ad0c5ecf071 dated 2023-10-15).

As I understand it, the zic bug does not occur in older NetBSD versions as they use zic.c from older tzcode versions that don't have the bug.

>How-To-Repeat:
To reproduce the problem, put the following into a file "data":

	Rule Canada 2007 max - Mar Sun>=8 2:00 1:00 D
	Rule Canada 2007 max - Nov Sun>=1 2:00 0    S
	Zone America/Vancouver	-8:00 -      PST  2026 Mar 9
				-8:00 Canada P%sT 2026 Nov 1 02:00
				-7:00 -      MST

and then run these shell commands:

   zic -d . data
   zdump -i $PWD/America/Vancouver

The output will end with these two lines:

  -          -  -08 PST
  2026-03-09 01 -07 PDT 1

which means the transition on November 1 at 02:00 is ignored.
>Fix:
To fix the problem, either upgrade zic.c to tzcode 2026b or later, or apply the one-line patch to zic.c documented here:

https://github.com/eggert/tz/commit/d63b92876ee6b57061fa8fb30500fcd11dbe9271




Home | Main Index | Thread Index | Old Index