Current-Users archive

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

Re: tzcode or glib2 bug?



Hi!

Thanks.

With fat files:

# TZ=/usr/share/zoneinfo-test/Europe/Vienna date; TZ=/usr/share/zoneinfo-test/Europe/Vienna ./a.out
Di. Feb. 11 09:47:29 CET 2020
local time: 09:47:29
UTC time: 08:47:29

Compared to before:
# TZ=/usr/share/zoneinfo/Europe/Vienna date; TZ=/usr/share/zoneinfo/Europe/Vienna ./a.out
Di. Feb. 11 09:47:44 CET 2020
local time: 10:47:44
UTC time: 08:47:44

So this seems to be the issue, and I'll raise a glib2 bug report now.

Thanks,
 Thomas

On Mon, Feb 10, 2020 at 07:57:45PM -0500, Christos Zoulas wrote:
> You could cd /usr/src/external/public-domain/tz/share/zoneinfo, edit
> the Makefile to change TZDIR and add -b fat to the TOOL_ZIC invocations.
> That would build all zones to the new directory.
> 
> christos
> 
> > On Feb 10, 2020, at 4:17 PM, Thomas Klausner <tk%giga.or.at@localhost> wrote:
> > 
> > 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