Skip to content
Tcl Source Code Artifact [229e13b0c6]
Login

Artifact [229e13b0c6]

Artifact 229e13b0c68f03fde697a4aa8cc7665b47e12a0f0a9133f6e3c4ac5b044b0a87:

Ticket change [229e13b0c6] - Ticket [832d098fdfec8f00|832d098fdf] <i>Clock reads TZif version 3 and 4 zoneinfo files as version 1 - zones with an extended footer lose all their transitions</i> status still Open with 3 other changes by kenneth.kienle on 2026-09-08 05:57:17.
D 2026-09-08T05:57:17.386
J icomment There\sis\sa\sbranch\sfor\sthis\son\sbug-832d098fdf-8.6,\soff\score-8-6-branch.\r\n\r\nHow\sthis\scame\sup,\ssince\sit\sexplains\sthe\sodd\sconfiguration:\sI\sbuild\sand\stest\r\nTcl\s8.6\sagainst\sthe\ssystem's\stzdata\srather\sthan\sthe\sbundled\scopy.\sThat\r\nsurfaced\sthis\sissue,\sand\sa\sdefault\sbuild\sdoes\snot\sshow\sit.\r\n\r\nThe\sreader\sused\sthe\s64-bit\sblock\sand\sthe\sfooter\sonly\swhen\sthe\sversion\sbyte\swas\r\nexactly\s"2".\sRFC\s9636\ssection\s3.1\sdefines\s'2',\s'3'\sand\s'4'\sas\seach\sconforming\r\nto\sthe\sone\sbefore,\sand\ssection\s4\ssays\sa\sreader\sshould\suse\sthe\sversion\s1\sblock\r\nonly\sto\sskip\sover\sit.\sWith\stzdata\s2026c,\s12\sof\s598\szones\sare\sversion\s3:\r\n\r\n\s\s\s\szic\s-b\sslim\s-d\szi\safrica\santarctica\sasia\saustralasia\seurope\s\\\r\n\s\s\s\s\s\s\s\snorthamerica\ssouthamerica\setcetera\sbackward\sfactory\r\n\s\s\s\sfor\sf\sin\s$(find\szi\s-type\sf);\sdo\r\n\s\s\s\s\s\s\s\s[\s"$(head\s-c5\s$f\s|\stail\s-c1)"\s=\s3\s]\s&&\secho\s$f\r\n\s\s\s\sdone\r\n\r\n\s\sAsia/Jerusalem,\sAsia/Tel_Aviv,\sIsrael,\sAsia/Gaza,\sAsia/Hebron,\r\n\s\sAmerica/Santiago,\sChile/Continental,\sChile/EasterIsland,\sPacific/Easter,\r\n\s\sAmerica/Godthab,\sAmerica/Nuuk,\sAmerica/Scoresbysund\r\n\r\nWhen\sthis\sis\sreachable\smatters.\sSetupTimeZone\sreads\sthe\sbundled\stzdata\sfirst,\r\nso\sa\sdefault\sbuild\sis\snot\saffected.\sIt\saffects\sbuilds\smade\swith\s--with-\r\ntzdata=no,\szones\sthat\sare\snot\sin\sthe\sbundled\scopy,\sand\sTZif\sfiles\sread\r\ndirectly.\r\n\r\nStock\s8.6,\sno\sbundled\stzdata,\sreading\sthe\sreal\sslim\sAsia/Jerusalem:\r\n\r\n\s\s\s\s@1700000000\s->\s'+0000\s'\s\s\s\s\s\s\s\s(UTC,\sempty\sabbreviation)\r\n\s\s\s\spatched\s\s\s\s\s->\s'+0200\sIST'\s\s\s\s\s(glibc\sagrees)\r\n\r\nWith\sfat\sdata\sthe\sreader\sfalls\sback\sto\sthe\s32-bit\sblock\sinstead,\swhich\scannot\r\nhold\sa\stransition\safter\s2038\sand\shas\sno\sfooter:\r\n\r\n\s\s\s\sAmerica/Nuuk\s2040-07-01\s\s\sstock\s-0200\s\s\spatched\s-0100\s\s\sglibc\s-0100\r\n\s\s\s\sAsia/Gaza\s\s\s\s2050-07-29\s\s\sstock\s+0200\s\s\spatched\s+0300\s\s\sglibc\s+0300\r\n\r\nThe\sscope\sis\sall\s598\szones\sfrom\sa\sslim\sbuild,\sat\s12\sinstants\sfrom\s1938\sto\r\n2084,\sthrough\sstock\sand\spatched:\s144\sof\s7176\sresults\sdiffer,\sall\sof\sthem\r\ninside\sthose\s12\szones.\sNo\sother\szone\schanges\sat\sany\sinstant.\sOn\sall\s144,\r\npatched\sagrees\swith\sglibc\sand\sstock\sdoes\snot.\r\n\r\nTwo\sfurther\schanges\sgo\swith\sthe\sfooters\sthat\sversion\s3\sexists\sfor.\sThe\r\ntransition\shour\snow\stakes\san\soptional\ssign\sand\sup\sto\sthree\sdigits,\swhich\r\ncovers\sthe\ssection\s3.3.2\srange\sof\s-167\sto\s167\s(the\spattern\sis\sa\ssuperset\sof\r\nit;\sno\sbound\sis\senforced).\sOf\sthe\s598\szones\sin\sa\sslim\s2026c\sbuild,\sthree\swrite\r\na\ssigned\shour\s-\sAmerica/Godthab,\sAmerica/Nuuk\sand\sAmerica/Scoresbysund,\sall\r\n/-1.\sNone\swrite\sa\sthree-digit\shour,\sso\sthe\ssign\sis\sneeded\sby\sdata\sthat\sexists\r\ntoday\sand\sthe\swidth\sis\sforward\scompatibility.\sAnd\sthe\ssign\sapplies\sto\sthe\r\nwhole\stime\sof\sday,\snot\sto\sthe\shours\sfield\salone,\sbecause\s[::scan\s-0\s%d]\r\nreturns\s0\sand\sloses\sit.\r\n\r\nThe\sversion\stest\sis\s[string\sis\sdigit\s-strict\s$version]\s&&\s$version\s>=\s2.\sThe\r\n-strict\sguard\sis\snot\sabout\sversion\s1:\sa\sversion\s1\sfile\shas\sNUL\sin\sthat\sbyte,\r\nand\sboth\sNUL\sand\sASCII\s'1'\salready\sfail\sa\sbare\s>=\s2.\sWhat\sit\sstops\sis\sany\snon-\r\ndigit\sbyte\sfrom\s0x3a\sup,\swhich\sTcl's\sstring\scomparison\swould\sotherwise\saccept\r\n-\s198\sbyte\svalues.\r\n\r\nAccepting\sversion\s4\sis\sforward\scompatibility\sonly.\sReadZoneinfoFile\srefuses\sa\r\nfile\swhose\sversion\s1\sheader\sdeclares\sleap\sseconds,\sand\sa\szic-written\sversion\s4\r\nfile\shas\sthem,\sso\sin\sthe\sfat\scase\ssuch\sa\sfile\sdoes\snot\sreach\sthe\snew\sbranch.\r\n\r\nTests\sclock-56.5\sto\s56.11\suse\ssynthetic\sTZif\sfiles\sand\sneed\sneither\ssystem\snor\r\nbundled\stzdata.\sReverting\sone\smechanism\sat\sa\stime,\smeasured:\r\n\r\n\s\s\s\sversion\scheck\s(either\ssite)\s\s\s\s\s\s\s\s\s\s\s\sfails\s56.5,\s56.6,\s56.7\r\n\s\s\s\ssigned\s/\sthree-digit\shour\spattern\s\s\s\s\s\sfails\s56.8,\s56.9,\s56.10,\s56.11\r\n\s\s\s\ssign\sapplied\sto\sthe\swhole\stime\sof\sday\s\sfails\s56.10,\s56.11\r\n\s\s\s\ssign\staken\sfrom\s[::scan],\snot\sthe\stext\sfails\s56.11\r\n\r\nNo\stest\sseparates\sthe\stwo\sversion-check\ssites\sfrom\seach\sother;\sreverting\r\neither\sone\sfails\sthe\ssame\sthree.\r\n\r\n56.9\sis\sdeliberately\sabsent\sfrom\sthe\sthird\srow.\sIts\sfooter\sis\sM3.5.0/-1,\swith\r\nno\sminutes\sand\sno\sseconds,\sso\s`sign\s*\s(h\s*\s3600)`\sand\s`(sign\s*\sh)\s*\s3600`\sare\r\nthe\ssame\snumber\sand\sthe\sfixture\scannot\ssee\swhich\sone\sthe\scode\scomputes.\sIt\sis\r\ncoverage\sfor\sthe\shour\spattern,\swhich\sis\sthe\srow\sit\sdoes\sappear\sin.\sI\smention\r\nit\sbecause\sa\sreader\swho\sreverts\sby\sdropping\sthe\ssign\sfactor,\srather\sthan\sby\r\nrestoring\sthe\sold\splacement,\swill\ssee\s56.9\sfail\sand\sconclude\sthe\stable\sis\r\nwrong.\r\n\r\nIf\syou\scheck\sthe\sfixtures\swith\sanother\stool\sthey\scontain\sno\stransitions,\sand\r\nglibc\signores\sa\sfooter\sin\sthat\scase,\sso\s`TZ=:<file>\sdate`\swill\sdisagree.\sRFC\r\n9636\ssection\s3.2\ssays\sthe\sfooter\sgoverns\swhen\sthere\sare\sno\stransitions.\sThe\r\nexpected\svalues\swere\scomputed\swith\sglibc\sfrom\seach\sfooter's\sTZ\sstring\sinstead.\r\n\r\nOne\sissue\sI\sfound\snext\sto\sthis\sand\sdid\snot\stouch\s(it\sis\sseparate\sand\salready\r\nreachable\swithout\sthis\schange)\sis\sthat\sthe\sleap-second\srefusal\sabove\sreads\sthe\r\nVERSION\s1\sheader,\sand\szic\s-b\sslim\swrites\sthat\sblock\sempty,\sso\sa\sslim\sfile\swith\r\nleap\sseconds\spasses\sthe\sguard.\sThe\sfooter\sseek\sthen\suses\s`8\s*\s$nLeap`,\sbut\r\nleap\srecords\sin\sthe\s64-bit\sblock\sare\s12\sbytes,\sso\sthe\sfooter\sis\sread\sfrom\sthe\r\nwrong\soffset.\sMeasured\son\sa\szic\s-b\sslim\s-L\sleapseconds\sbuild\sof\s2026c:\r\n\r\n\s\s\s\sEurope/Berlin\s(version\s2,\s27\sleap\srecords)\r\n\s\s\s\s\s\s\s\sstock\s8.6\stoday\s->\serror,\s"unable\sto\sparse\stime\szone\sspecification"\r\n\r\nThis\sis\snot\scaused\sby\sthis\sbranch,\sbut\sthis\sbranch\sdoes\smake\sit\sreachable\sfor\r\nthe\s12\sversion\s3\szones,\swhich\sgo\sfrom\ssilently\swrong\sto\sthat\ssame\serror:\r\n\r\n\s\s\s\sAsia/Jerusalem\s\sstock\s'+0000\s'\s\s->\s\spatched:\sthe\sparse\serror\r\n\s\s\s\sAmerica/Nuuk\s\s\s\sstock\s'+0000\s'\s\s->\s\spatched:\sthe\sparse\serror\r\n\r\nChanging\s`8\s*\s$nLeap`\sto\s`12\s*\s$nLeap`\smakes\sall\sthree\scorrect\sand\sagree\swith\r\nglibc\son\soffset\sand\sabbreviation.\sI\shave\skept\sit\sout\sof\sthis\sbranch\sto\skeep\r\nthings\sin\sscope.\sI'm\shappy\sto\sfile\sit\sseparately\sor\sto\sadd\sit\shere,\sI\sjust\r\ndidn't\swant\sit\sto\sbe\sa\ssurprise.\r\n\r\nThis\sis\sstill\sopen\son\strunk:\slibrary/clock.tcl\sthere\shas\sthe\ssame\s$version\seq\r\n"2"\stest\sand\sthe\ssame\stwo-digit\shour\spattern.\r\n\r\nKenneth
J login kenneth.kienle
J mimetype text/x-markdown
K 832d098fdfec8f004cf1c8e8836f7c335da12d54
U kenneth.kienle
Z 7ae797dfeb625c0b73fced4147bbda26