Current-Users archive

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

Re: tzcode or glib2 bug?



On Mon, Feb 10, 2020 at 09:08:18PM -0000, Christos Zoulas wrote:
> In article <20200210172958.azwyzrq3d773gm56@danbala>,
> Thomas Klausner  <tk%giga.or.at@localhost> wrote:
> >-=-=-=-=-=-
> >
> >Hi!
> >
> >Some weeks/months ago I noticed that some tools displayed the wrong
> >time, one hour in the future (right now, on 9.99.46/amd64)
> >
> >I've tracked this down to those using glib2 and wrote a small test
> >program.
> >
> ># gcc test.c `pkg-config --cflags glib-2.0` `pkg-config --libs glib-2.0`
> ># ./a.out; date
> >local time: 19:22:59
> >UTC time: 17:22:59
> >Mo. Feb. 10 18:22:59 CET 2020
> >
> >I have /etc/localtime symlinked:
> >
> >lrwxr-xr-x  1 root  wheel  33 May 31  2019 /etc/localtime ->
> >/usr/share/zoneinfo/Europe/Vienna
> >
> >(and this is handled correctly by glib2) but it doesn't work with
> >explicitly given TZ environment variable either.
> >
> ># TZ=Europe/Vienna ./a.out; TZ=Europe/Vienna date
> >local time: 19:24:45
> >UTC time: 17:24:45
> >Mo. Feb. 10 18:24:45 CET 2020
> >
> >Other timezones work:
> >
> ># TZ=EST ./a.out; TZ=EST date
> >local time: 12:24:35
> >UTC time: 17:24:35
> >Mo. Feb. 10 12:24:35 EST 2020
> >
> >Is there something weird in NetBSD's version of tzcode (I see we have
> >quite some changes) and we notice because glib2 has its own parser, or
> >is it a bug in glib2?
> >
> >(I debugged it into glib2 and found that it identifies the timezone
> >correctly from the symlink and then calls init_zone_from_iana_info(),
> >see
> >https://github.com/GNOME/glib/blob/mainline/glib/gtimezone.c#L522.)
> 
> If you zic -b the zone does it work?

How would I do that as a one-off test?

 Thomas


Home | Main Index | Thread Index | Old Index