bugGNUstep - Bugs: bug #30026, Unknown time zone name `PST'

Group
 
 

bug #30026: Unknown time zone name `PST'

Submitter:  David Wetzel <dwetzel>
Submitted:  Tue 01 Jun 2010 06:02:26 PM UTC
   
 
Category:  Base/Foundation Severity:  2 - Minor
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 16 Jun 2010 10:49:33 AM UTC, comment #14: 

Thanks very much for the patch ... I applied it with only minor changes and tested it on my system.

Richard Frith-Macdonald <CaS>
Group Member
Wed 16 Jun 2010 09:54:37 AM UTC, comment #13: 

Sorry for the late response.

I had the problem on Ubuntu with time zone detecting for
SYSTEM_TIME_FILE (/etc/localhost) was copied (not symlinked)
by Gnome. The time zone can be detected even with my time zone
abbreviation (which haven't the univocal correspondence with
the time zone name) by comparing SYSTEM_TIME_FILE with the list of
zoneinfo files. The file list can be built from the time zone
names list for such time zone abbreviation (e.g. SAMT is valid for
Pacific/Samoa, Pacific/Pago_Pago, Pacific/Apia, Asia/Samarkand,
Europe/Samara, US/Samoa).

The patch implements this approach.
It can slow down time zone detecting due to calling of
[NSTimeZone abbreviationMap] so the patch emits the log message
about how to elaborate this by setting of the environment.


(file #20761)

Sergei Golovin <svg>
Thu 03 Jun 2010 06:37:46 AM UTC, comment #12: 

As I pointed out, abbreviations are not really valid timezone names ... and SAMT is both an abbreviation for Europe/Samara (UTC+4) and for Pacific/Samoa (UTC-11).

So in this case it's impossible to work around the bad system timezone setting by accepting an abbreviation, and you need to either correct the timezone name set for your system, or override it.

I've updated the error/help output again ... hopefully it's now clear/informative enough to let people know exactly what then need to do.

Richard Frith-Macdonald <CaS>
Group Member
Thu 03 Jun 2010 05:28:43 AM UTC, comment #11: 

r30551

It now works as expected with both "Europe/Moscow" set either by Gnome or from the environment (TZ="Europe/Moscow").
It still emits the warnings with "Europe/Samara" set by Gnome.
-------------------------------------------------------------
2010-06-03 05:26:56.464 nstz[7950] Unable to create time zone for name: 'SAMT' (source 'function: 'tzset()/tzname'').
2010-06-03 05:26:56.465 nstz[7950] It seems that your operating system does not have a valid timzone names configured ... please correct that or override by setting the 'Local Time Zone' user default to a timezone name (such as 'Europe/London' or 'America/Chicago')
2010-06-03 05:26:56.465 nstz[7950] Using time zone with absolute offset 0.
-------------------------------------------------------------

Sergei Golovin <svg>
Wed 02 Jun 2010 03:58:48 PM UTC, comment #10: 

Changed to tolerate abbreviations supported in the timezone database.

Richard Frith-Macdonald <CaS>
Group Member
Wed 02 Jun 2010 01:07:12 PM UTC, comment #9: 

I am just informing that it works for me with alternate timezone names MSD for Europe/Moscow and SAMST for Europe/Samara by setting the environment variable TZ. MSK and SAMT that Gnome sets for my timezones don't work.

base-r30541 (with Richard's fresh changes)

Sergei Golovin <svg>
Wed 02 Jun 2010 11:02:09 AM UTC, comment #8: 

It emits nothing with "Europe/London" .
It has emited with "Europe/Moscow":
-------------------------------------------------------------
2010-06-02 10:48:24.533 nsstring[32661] Unknown time zone name `MSK'.
2010-06-02 10:48:24.533 nsstring[32661] Unable to create time zone for name: 'MSK' (source 'function: 'tzset()/tzname'').
2010-06-02 10:48:24.533 nsstring[32661] It seems that your operating system does not have a valid timzone names configured ... please correct that or override by setting the 'Local Time Zone' user default to a timezone name (such as 'Europe/London' or 'America/Chicago')
2010-06-02 10:48:24.533 nsstring[32661] Using time zone with absolute offset 0.
-------------------------------------------------------------

Ubuntu 9.10
base-r30539
Linux acer5610 2.6.31-21-generic #59-Ubuntu SMP Wed Mar 24 07:28:56 UTC 2010 i686 GNU/Linux

Sergei Golovin <svg>
Wed 02 Jun 2010 10:57:07 AM UTC, comment #7: 

The problem is that PST is not a valid timezone name (it's an abbreviation) ... so you shouldn't really be able to set it as your timezone name, and you arguably have an operating system bug.  Timezone handling is so non-standard in general that it's probably pointless to make that argument though.

However, I've made the obvious hack/workaround ... changing the code to accept abbreviations.  The problem with that is that those don't necessarily uniquely identify timezones.

Richard Frith-Macdonald <CaS>
Group Member
Wed 02 Jun 2010 09:33:29 AM UTC, comment #6: 

Well this is a Ubuntu 10.04 release. The desktop.
The Gnome time thing and the date command show me the correct time with my time zone, which is PST.

http://en.wikipedia.org/wiki/Pacific_Standard_Time

If I set my time to CEST the error message goes away.
If I set it again to PST, it is there again.
Easy to reproduce.
Maybe somebody else on Linux/Ubuntu can check?

Dave

David Wetzel <dwetzel>
Group Member
Wed 02 Jun 2010 08:46:57 AM UTC, comment #5: 

Ah in that case it looks like your operating system is in error and GNUstep is simply reporting it ... the system is returning an invalid timezone name ... presumably you need to set the system timezone properly (or override the timezone name reported by the system).
Or perhaps you know better?

Richard Frith-Macdonald <CaS>
Group Member
Wed 02 Jun 2010 08:22:49 AM UTC, comment #4: 

2010-06-01 18:28:06.111 EOModelEditor[24168] Unknown time zone name `PST'.    
2010-06-01 18:28:06.111 EOModelEditor[24168] Unable to create time zone for name: 'PST' (source 'function: 'tzset()/tzname'').                               
2010-06-01 18:28:06.111 EOModelEditor[24168] Using time zone with absolute offset 0.                                                                         

David Wetzel <dwetzel>
Group Member
Tue 01 Jun 2010 07:38:57 PM UTC, comment #3: 

Well .. looked like 'date' returned the correct time, and you have no environment variable set to specify the zone .. so unless you have the zone set in your user defaults or have set the localtime file in the GNUstep zones directory (which seems unlikely) that just leaves two possibilities:
1. your system has an incorrect timezone filename
2. your system has not timezone filename, and is returning the incorrect timezone in tzname.

My guess is that the problem is (1) ... so I've changed the order of precedence so we call the tzset() function and look at tzname (if available) before we resort to looking at the timezone filename.  This seems reasonable to me as it's probably relatively easy for someone to link '/etc/localtime' (or whatever is the local timezone file) to a file with the wrong name.  I didn't write the original code ... and Im not even sure that looking at the localtime file is supposed to be a reliable way of determining the timezone.

Richard Frith-Macdonald <CaS>
Group Member
Tue 01 Jun 2010 07:03:57 PM UTC, comment #2: 

I am not doing anything on time zones at this point.

Just add a NSLog() and you will see that.

My ENV is:

ORBIT_SOCKETDIR=/tmp/orbit-dave
SSH_AGENT_PID=1319
GNUSTEP_IS_FLATTENED=yes
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=7f015f0edd008e06c23dbbd14bda0ced-1275357192.318036-925129358
GNUSTEP_LOCAL_ROOT=/usr/GNUstep/Local
WINDOWID=54529775
OLDPWD=/home/dave/dev/gdl2/trunk
GNOME_KEYRING_CONTROL=/tmp/keyring-1errXi
GTK_MODULES=canberra-gtk-module
GNUSTEP_HOST=i686-pc-linux-gnu
USER=dave
LD_LIBRARY_PATH=/home/dave/GNUstep/Library/Libraries:/usr/GNUstep/Local/Library/Libraries:/usr/GNUstep/System/Library/Libraries
LS_COLORS=rs=0:di=01;34:ln=01;36:hl=44;37:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
GUILE_LOAD_PATH=/home/dave/GNUstep/Library/Libraries/Guile:/usr/GNUstep/Local/Library/Libraries/Guile:/usr/GNUstep/System/Library/Libraries/Guile
GNUSTEP_MAKEFILES=/usr/GNUstep/System/Library/Makefiles
GNUSTEP_NETWORK_ROOT=/usr/GNUstep/Network
GNUSTEP_FLATTENED=yes
SSH_AUTH_SOCK=/tmp/keyring-1errXi/ssh
GNUSTEP_HOST_OS=linux-gnu
DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
SESSION_MANAGER=local/pinguin:@/tmp/.ICE-unix/1285,unix/pinguin:/tmp/.ICE-unix/1285
USERNAME=dave
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
GNUSTEP_HOST_VENDOR=pc
DESKTOP_SESSION=gnome
PATH=/home/dave/GNUstep/Tools:/usr/GNUstep/Local/Tools:/usr/GNUstep/System/Tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PWD=/home/dave/dev/gdl2/trunk/Apps/EOModelEditor
GDM_KEYBOARD_LAYOUT=de mac
LANG=de_DE.utf8
GNOME_KEYRING_PID=1267
MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
GDM_LANG=de_DE.utf8
GNUSTEP_HOST_CPU=ix86
GDMSESSION=gnome
SPEECHD_PORT=7560
SHLVL=1
HOME=/home/dave
GNUSTEP_USER_ROOT=/home/dave/GNUstep
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNUSTEP_SYSTEM_ROOT=/usr/GNUstep/System
LOGNAME=dave
GNUSTEP_PATHLIST=/usr/GNUstep/System:/usr/GNUstep/Network:/usr/GNUstep/Local:/home/dave/GNUstep
CLASSPATH=/usr/GNUstep/System/Library/Libraries/Java:/usr/GNUstep/Local/Library/Libraries/Java:/home/dave/GNUstep/Library/Libraries/Java
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-zKxSOiGFv1,guid=c8eabbcf37881ca928e692124c046809
LIBRARY_COMBO=gnu-gnu-gnu
LESSOPEN=| /usr/bin/lesspipe %s
INFOPATH=/usr/GNUstep/System/Library/Documentation/info::/usr/GNUstep/Local/Library/Documentation/info::/home/dave/GNUstep/Library/Documentation/info:
DISPLAY=:0.0
LESSCLOSE=/usr/bin/lesspipe %s %s
XAUTHORITY=/var/run/gdm/auth-for-dave-vnDWDq/database
COLORTERM=gnome-terminal
_=/usr/bin/env

David Wetzel <dwetzel>
Group Member
Tue 01 Jun 2010 06:51:25 PM UTC, comment #1: 

What is the bug?

You provide an error message complaining about an invalid time zone name being set ... but no information about the context.  Where is your timezone set and why isn't it set to a valid name (what did you set it to)?

from the NSTimeZone documentation ...
   The local time zone can be specified with:
    1) the user defaults database
    2) the GNUSTEP_TZ environment variable
    3) the file LOCAL_TIME_FILE in _time_zone_path()
    4) the TZ environment variable
    5) TZDEFAULT defined in tzfile.h on platforms which have it
    6) tzset() & tznam[] for platforms which have it
    7) Windows registry, for Win32 systems
    8) or the fallback time zone (which is UTC)
   with the ones listed first having precedence.


Richard Frith-Macdonald <CaS>
Group Member
Tue 01 Jun 2010 06:02:26 PM UTC, original submission:  

2010-06-01 17:55:05.962 EOModelEditor[9225] Unknown time zone name `PST'.     
2010-06-01 17:55:05.962 EOModelEditor[9225] Using time zone with absolute offset 0.                                                                          

dave@pinguin:~$ date
Di 1. Jun 10:58:42 PDT 2010

LANG=de_DE.UTF-8

dave@pinguin:~$ uname -a
Linux pinguin 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:27:30 UTC 2010 i686 GNU/Linux
(Ubuntu 10.04)

David Wetzel <dwetzel>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #20761:  NSTimeZone_v2.patch added by svg (2KiB - text/x-patch - The patch to raise the probability rate of time zone detecting for some abbreviations)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by svg (Posted a comment)
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by dwetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-16 svg Attached File- Added NSTimeZone_v2.patch, #20761
    2010-06-03 CaS Open/ClosedIn Test Closed
    2010-06-02 CaS StatusInvalid Fixed
        Open/ClosedDeclined In Test
    2010-06-02 CaS StatusNeed Info Invalid
        Open/ClosedOpen Declined
    2010-06-01 CaS StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code