No daylight savings with Firefox snap when /etc/localtime is a regular file
Categories
(Firefox Build System :: Third Party Packaging, defect)
Tracking
(Not tracked)
People
(Reporter: mozbugs, Unassigned)
References
(Blocks 2 open bugs, )
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Steps to reproduce:
In Xubuntu 22.04 I used time-admin to set the timezone to Australia/Sydney. I started Firefox, using the snap version 110.0-3. I noticed that the time reported by the browser was incorrect. It was off by one hour, as if daylight savings time was not in effect.
I installed Firefox nightly but was not able to reproduce the problem. I suspect that it is specific to the snap package.
I discovered that the problem only occurs if /etc/localtime is a regular file. time-admin uses system-tools-backends to set the timezone, which contains the Perl code:
unlink $localtime; # Important, since it might be a symlink.
&Utils::Report::enter ();
$res = copy ($tz, $localtime);
&Utils::Report::leave ();
Arguably this is the wrong way to update the timezone, since man localtime(5) says that /etc/localtime should be a symlink. But it is old code, with a copyright date of 2000-2001, and is apparently widely used.
To reproduce, make /etc/localtime be a regular file:
sudo rm /etc/localtime
sudo cp /usr/share/zoneinfo/Australia/Sydney /etc/localtime
Start firefox from the snap, and in the console, type
new Date()
Actual results:
Date Mon Feb 20 2023 11:26:19 GMT+1000 (GMT+10:00)
Expected results:
Date Mon Feb 20 2023 12:26:19 GMT+1100 (GMT+11:00)
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Comment 2•2 years ago
|
||
The libc in the container is 2.31-0ubuntu9.9 from the "core20" snap. The libc in the host is 2.35-0ubuntu3.1. When /etc/localtime is a regular file, it is copied into the container and read by libc 2.31. Evidently libc 2.31 has a limited ability to read zoneinfo files made by libc 2.35.
Using a more recent libc would probably fix it.
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 3•2 years ago
|
||
I proposed a patch for system-tools-backends at https://bugs.launchpad.net/ubuntu/+source/system-tools-backends/+bug/2007806
Comment 4•2 years ago
|
||
The severity field is not set for this bug.
:gerard-majax, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 5•2 years ago
|
||
Amin, there's an upstream patch, can you have a look ?
Reporter | ||
Comment 6•2 years ago
|
||
Note that the real upstream is https://system-tools-backends.freedesktop.org/ , which hasn't had a release or a commit to its git repo since 2009. It's not used by Gnome anymore, but it's still used by Xubuntu (Xfce). The Debian package has been updated more recently, with a patch added in 2016. I filed my bug against the Ubuntu package because forcing Firefox users to use Snap is an Ubuntu decision, Debian is not doing that.
Comment 7•2 years ago
|
||
Thanks, the patch has been applied. Though, based on the above descriptions, this issue might be mitigated with our upcoming switch from core20 to core22 for the Firefox snap anyway.
Comment 8•2 years ago
|
||
Thanks all, I'm going to mark this as fixed now since the patch was applied. Please reopen if the issue persists
Description
•