icecat does not honor /etc/timezone starting with 102.3.0.

  • Open
  • quality assurance status badge
Details
2 participants
  • Jonathan Brielmaier
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
Merged with
M
M
Maxim Cournoyer wrote on 18 Nov 2022 20:50
(name . bug-guix)(address . bug-guix@gnu.org)
87iljc2gat.fsf@gmail.com
Hi,

I've recently found out that icecat wouldn't display time correctly for
my local time zone anymore (even when the 'resistFingerprinting' in
about:config is disabled, which would have usually resolved the
problem).

To test, I simply visit the https://everytimezone.com/,which shows your
current time.

This version from early September 2022 works:

Toggle snippet (3 lines)
/gnu/store/bzpyas70s9j95dqad00vafks5icg51dm-icecat-91.13.0-guix0-preview1/bin/icecat

While this one from the end of September 2022 doesn't

Toggle snippet (4 lines)
/gnu/store/bzpyas70s9j95dqad00vafks5icg51dm-icecat-91.13.0-guix0-preview1/bin/icecat


As a workaround, you can set your timezone explicitly (after ensuring
there are no longer running icecat processes) like so:

Toggle snippet (3 lines)
TZ=America/Montreal icecat

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 13 Feb 2023 23:17
(address . 59368@debbugs.gnu.org)
871qmtdxc1.fsf@gmail.com
Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (20 lines)
> Hi,
>
> I've recently found out that icecat wouldn't display time correctly for
> my local time zone anymore (even when the 'resistFingerprinting' in
> about:config is disabled, which would have usually resolved the
> problem).
>
> To test, I simply visit the https://everytimezone.com/, which shows your
> current time.
>
> This version from early September 2022 works:
>
> /gnu/store/bzpyas70s9j95dqad00vafks5icg51dm-icecat-91.13.0-guix0-preview1/bin/icecat
>
>
> While this one from the end of September 2022 doesn't
>
> /gnu/store/bzpyas70s9j95dqad00vafks5icg51dm-icecat-91.13.0-guix0-preview1/bin/icecat
>

The above problematic file name should have been that of icecat 102.3.0:

Toggle snippet (3 lines)
/gnu/store/4gph2kbnmy64ii0fs9msig2jzjsnxdxi-icecat-102.3.0-guix0-preview1

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 14 Feb 2023 03:13
(address . 59368@debbugs.gnu.org)
87wn4lc7tt.fsf@gmail.com
Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (28 lines)
> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> Hi,
>>
>> I've recently found out that icecat wouldn't display time correctly for
>> my local time zone anymore (even when the 'resistFingerprinting' in
>> about:config is disabled, which would have usually resolved the
>> problem).
>>
>> To test, I simply visit the https://everytimezone.com/, which shows your
>> current time.
>>
>> This version from early September 2022 works:
>>
>> /gnu/store/bzpyas70s9j95dqad00vafks5icg51dm-icecat-91.13.0-guix0-preview1/bin/icecat
>>
>>
>> While this one from the end of September 2022 doesn't
>>
>> /gnu/store/bzpyas70s9j95dqad00vafks5icg51dm-icecat-91.13.0-guix0-preview1/bin/icecat
>>
>
> The above problematic file name should have been that of icecat 102.3.0:
>
> /gnu/store/4gph2kbnmy64ii0fs9msig2jzjsnxdxi-icecat-102.3.0-guix0-preview1

Looking through IRC logs, Tobias had shared the following insight about
the problem:

Toggle snippet (5 lines)
2022-11-14 16:15:25 nckx podiki[m], apteryx: IceCat assumes that
/etc/localtime is a symlink to <zoneinfo>/share/zoneinfo/Your/TZ, and
bugs out if it isn't. Some GNOME software is similarly broken.

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 14 Feb 2023 06:00
(address . 59368@debbugs.gnu.org)
87h6vodeom.fsf@gmail.com
Hi,

Pushing the investigation a bit, the Mozilla suite makes use of ICU to
get to know the host timezone name, and reviewing its source, I confirm
the behavior experienced. The ICU-provided
'TimeZone::detectHostTimeZone' procedure calls to 'uprv_tzname' which
first attempts to read the TZ environment variable, else expects
/etc/localtime to be a symlink.

I found another explanation for the rationale behind the /etc/localtime
being a symlink design choice [0]:

On many systems /etc/localtime is a symlink to a timezone file. It is
conceivable that a program might be running when the /etc/localtime
symlink is updated. If this were to happen, glibc would notice this
when localtime is called and re-read the file before doing any time
conversions.


This article is worth reading and further demonstrates that simply
setting the TZ environment variable can lead to a large reduction of
system calls (from 11 to 1 for a every 'time' C library call).

So the choice to make here for Guix would be:

1. Do as most other distributions and have /etc/localtime be a symlink
pointing to the timezone file.

OR

2. Set TZ and reap some performance benefits.

The disadvantage of going with 2. is that users would then require to
restart their system following a reconfiguration changing their time
zone, which is not user friendly.

So I think I'd go with 2, knowing that savvy users wanting to shave some
extra resources can always set the TZ environment variable themselves.

Thoughts?

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 14 Feb 2023 17:32
(address . 59368@debbugs.gnu.org)
87zg9gb42n.fsf@gmail.com
Hi,

The commit that updated icecat from version 91.13.0 to 102.3.0 is
4e88a7bfcb70f25219d9f2887121ae196431a115. One of the changes listed is
an update from icu4c (which is/was at version 69.1) to icu4c-71 (71.1).
ICU seems to deal with reading /etc/localtime and /etc/timezone, so
perhaps its behavior changed.

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 14 Feb 2023 17:34
(address . 59368@debbugs.gnu.org)(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87y1p0b3z1.fsf@gmail.com
Hello,

I've logged a feature request with ICU upstream at

In the meantime, we can apply a patch to our icu4c@71 on master or icu4c
on core-updates to substitute the zoneinfo file name in

Toggle snippet (3 lines)
"#define TZZONEINFO "/usr/share/zoneinfo/""

from the putil.cpp file of ICU.

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 15 Feb 2023 03:45
(address . 59368@debbugs.gnu.org)(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
875yc3hcir.fsf@gmail.com
Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (12 lines)
> Hello,
>
> I've logged a feature request with ICU upstream at
> https://unicode-org.atlassian.net/browse/ICU-22278.
>
> In the meantime, we can apply a patch to our icu4c@71 on master or icu4c
> on core-updates to substitute the zoneinfo file name in
>
> "#define TZZONEINFO "/usr/share/zoneinfo/""
>
> from the putil.cpp file of ICU.

It seems this was a red herring; patching this reference doesn't help.
I've made the following minimal reproducer to convince myself that ICU
worked in isolation:

Toggle snippet (22 lines)
#include <stdio.h>
#include <stdlib.h>

#include <unicode/ucal.h>
#include <unicode/ustring.h>

int main() {
UChar result[100]; /* char16_t array */
UErrorCode errorCode = U_ZERO_ERROR;
char timezone[200];

ucal_getHostTimeZone(result, 100, &errorCode);

if (!u_austrncpy(timezone, result, 100)) {
printf("error: failed to convert UChar array to byte string\n");
exit(1);
}

printf("host timezone: %s\n", timezone);
}

Building and running it yields:

Toggle snippet (6 lines)
$ make icu-repro && ./icu-repro
gcc -I ./install/include -L ./install/lib -licudata -licuuc -licui18n \
-g3 -O0 icu-repro.c -o icu-repro
host timezone: US/Eastern

Which is correct for my America/Montreal defined timezone.

To be continued...

--
Thanks,
Maxim
J
J
Jonathan Brielmaier wrote on 15 Feb 2023 20:00
icecat does not honor /etc/timezone starting with 102.3.0.
(address . 59368@debbugs.gnu.org)
c0c70a34-d360-df14-4033-46ae0e1c1c19@web.de
Yes, its the wrong timezone: UTC instead of CEST with Icecat.
This resistFingerprinting doesn't seem to change something in that regard.

I can further say that I don't see this issue with firefox-esr or icedove.
M
M
Maxim Cournoyer wrote on 15 Feb 2023 20:50
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)(address . 59368@debbugs.gnu.org)
87v8k2aet7.fsf@gmail.com
Hi Jonathan,

Jonathan Brielmaier <jonathan.brielmaier@web.de> writes:

Toggle quote (5 lines)
> Yes, its the wrong timezone: UTC instead of CEST with Icecat.
> This resistFingerprinting doesn't seem to change something in that regard.
>
> I can further say that I don't see this issue with firefox-esr or icedove.

Thanks for confirming the issue. I investigated with a vanilla Firefox
build and reported my findings upstream [0]. The bug is triggered when
the default value for privacy.resistFingerprinting is set to 'true', as
done by the makeicecat script.


--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 19 Jul 2023 20:18
control message for bug #55089
(address . control@debbugs.gnu.org)
87r0p3kbnv.fsf@gmail.com
merge 55089 59368
quit
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 59368@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 59368
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch