Bug 441817 - Bad handling of broken /etc/localtime file
Summary: Bad handling of broken /etc/localtime file
Status: RESOLVED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.21.5
Platform: unspecified Linux
: NOR grave
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-31 15:28 UTC by Mihai Sorin Dobrescu
Modified: 2022-11-05 03:16 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
broken localtime sample file (116 bytes, application/octet-stream)
2021-08-31 15:28 UTC, Mihai Sorin Dobrescu
Details
Calendar widget sample (42.01 KB, image/png)
2021-08-31 15:29 UTC, Mihai Sorin Dobrescu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mihai Sorin Dobrescu 2021-08-31 15:28:10 UTC
Created attachment 141184 [details]
broken localtime sample file

SUMMARY

At some point, a deffective /etc/localtime was created (outside Plasma) and that rendered KDE Plamsa apps or widgets depending on the timezone almost unusable, created infinite loops, Plasma unresponsiveness.

STEPS TO REPRODUCE
1. Have a bad /etc/localtime file (see attached)

2. The system boots and identifies the time zone as "-00"

In journal:

Aug 31 13:48:08 myuser kded5[768]: System timezone has been changed, new timezone is "-00"

Plasma starts and timedatectl reports:

-----------------------------------------------------------

               Local time: Tue 2021-08-31 11:03:30 UTC
           Universal time: Tue 2021-08-31 11:03:30 UTC
                 RTC time: Tue 2021-08-31 14:03:28
                Time zone: n/a (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

-----------------------------------------------------------

~/.config/ktimezonedrc is created as:

-----------------------------------------------------------
[TimeZones]
LocalZone=-00
ZoneinfoDir=/usr/share/zoneinfo
Zonetab=/usr/share/zoneinfo/zone.tab
-----------------------------------------------------------

3. 

OBSERVED RESULT

I'll take the Calendar widget (part of several widgets such as the Calendar and the Digital Clock) as example. It displays time zone as UTC, but it is not handled as UTC. The title of the calendar becomes "0 %2(I18N_ARGUMENT_MISSING)", the days outside the current month are numbered like "-5 -4 -3 -2 -1 0" and the numbering continues beyond the end of the month like "32 33 34 35 36". The digital clock disappears from the desktop if placed there, also it is not really visible in the system tray - although can be selected to go to settings and try to add the calendar events - at this point, when apply, becomes unresponsive, sometimes Plasma too.

If KDE Plasma time zone settings are tried, they display UTC as time zone, but the user must select and apply UTC in order to fix Plasma behavior.


EXPECTED RESULT

In case of broken time zone file, a message should be displayed and a valid UTC setting should be created and used optionally in the system and mandatory in ~/.config/ktimezonedrc to ensure normal operation.


SOFTWARE/OS VERSIONS
Windows: -
macOS: -
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Mihai Sorin Dobrescu 2021-08-31 15:29:11 UTC
Created attachment 141185 [details]
Calendar widget sample
Comment 2 Nate Graham 2021-08-31 18:03:56 UTC
That seems bad.
Comment 3 Nate Graham 2022-11-05 03:16:37 UTC
On investigation, this will break basically everything and it's not Plasma's job to be resilient against such misconfigurations, sorry!