Opened 12 years ago

Closed 12 years ago

#6416 closed patch (duplicate)

Time Zone Detection Failure Prevents Frontend From Running

Reported by: mythtv@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: MythTV - General Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: no


A detected mismatch in time zone configuration between the master backend and a frontend causes the frontend it exit with a fatal error.

Further investigation revealed a number of problems with the time zone detection implementation:

My master backend runs on Slackware, which copies the configured zoneinfo database to /etc/localtime. The detection system attempts to handle this scenario by using the findZoneinfoFile() function to search the contents of the /usr/share/zoneinfo directory looking for a binary equivalent file in order to obtain its file name and consequently the time zone. This approach relies on each file contained within the /usr/share/zoneinfo directory being unique, which is not the case. My system is configured with Europe/London however the first identical file matched is Europe/Belfast.

With my backend reporting Europe/Belfast, despite being configured Europe/London, a frontend running on Mac OSX that correctly detected its configuration of Europe/London would simply terminate on execution.

I replaced the findZoneinfoFile() with a searchZoneinfo() search function, which continues searching beyond finding an initial match to see if the match is unique. If multiple matches are discovered the results are deemed inconclusive and "UNDEF" is reported.

If "UNDEF" is detected the implementation goes on to attempt to obtain the time zone from the strftime() function. Unfortunately this function reported "BST" (for British Summer Time), so the Mac frontend still wouldn't run properly.

This led to modification of the implementation of checkTimeZone() so that it only reports a fatal error if the time obtained from the backend is sufficiently different to the local time. It merely reports a warning if the times match but the detected time zones differ.

Slackware actually creates an /etc/localtime-copied-from symlink to the original zoneinfo file. Support for correctly detecting the configured time zone was added using that information, where available.

The whole process of detecting time zones seems to me to be prohibitively error prone and should be removed IMHO.

Attachments (1)

time_zone_detect_r20297.patch (13.3 KB) - added by mythtv@… 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by mythtv@…

comment:1 Changed 12 years ago by sphery <mtdean@…>

dup of #5872 (note, also, there's another outstanding time zone fix at #5896 )

comment:2 Changed 12 years ago by danielk

Resolution: duplicate
Status: newclosed

dup of #5896, which has a more correct fix.

Note: See TracTickets for help on using tickets.