[mythtv-commits] Ticket #6416: Time Zone Detection Failure Prevents Frontend From Running

MythTV mythtv at cvs.mythtv.org
Wed Apr 1 20:11:23 UTC 2009


#6416: Time Zone Detection Failure Prevents Frontend From Running
---------------------------------+------------------------------------------
 Reporter:  mythtv at dadeos.co.uk  |       Owner:  ijr    
     Type:  patch                |      Status:  new    
 Priority:  minor                |   Milestone:  unknown
Component:  MythTV - General     |     Version:  unknown
 Severity:  medium               |     Mlocked:  0      
---------------------------------+------------------------------------------
 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.''

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/6416>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list