Debian Bug report logs - #416452
sun-java5-jre: Incorrect default timezone detected

version graph

Package: sun-java5-jre; Maintainer for sun-java5-jre is (unknown);

Reported by: "Tzvetan Mikov" <tmikov@gmail.com>

Date: Wed, 28 Mar 2007 02:30:01 UTC

Severity: important

Found in versions sun-java5/1.5.0-10-3, sun-java5/1.5.0-14-3, sun-java5/1.5.0-16-3

Fixed in version 1.5.0-20-1+rm

Done: Andreas Beckmann <anbe@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@ubuntu.com>:
Bug#416452; Package sun-java5-jre. (full text, mbox, link).


Acknowledgement sent to "Tzvetan Mikov" <tmikov@gmail.com>:
New Bug report received and forwarded. Copy sent to Matthias Klose <doko@ubuntu.com>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: "Tzvetan Mikov" <tmikov@gmail.com>
To: submit@bugs.debian.org
Subject: sun-java5-jre: Incorrect default timezone detected
Date: Tue, 27 Mar 2007 19:29:20 -0700
Package: sun-java5-jre
Version: 1.5.0-10-3
Severity: important
*** Please type your report below this line ***

The default system timezone is detected incorrectly under Etch. The
system is configured for "US/Pacific", however Java reports
"SystemV/PST8PDT". The latter timezone doesn't have the correct DST
settings in Java, so incorrect time is displayed.

Steps to reproduce:
- Configure the system timezone to US/Pacific

- In Java execute:
 System.out.println( java.util.TimeZone.getDefault().getDisplayName() );
It will show "SystemV/PST8PDT"

- In Java execute "System.out.println( new java.util.Date() );". It
currently prints the incorrect time. It will probably start printing
correctly again soon, when we enter the old (pre-2007) DST period.

I noticed that /etc/localtime is no longer a link in Etch. I changed
it back to a symbolic link to "/usr/share/zoneinfo/US/Pacific" and
Java started working correctly again.

My conclusion is that Sun JVM relies on the _path and name of the zone
file_ to determine the zoneID (which it then matches to its own
timezone database). However since in Etch the file is no longer a
link, so they must be comparing it binary  against all files under
"/usr/share/zoneinfo".

"/usr/share/zoneinfo/SystemV/PST8PDT" is the same file binary as
""/usr/share/zoneinfo/US/Pacific", however it is found first !

To confirm this I restored "/etc/localtime" to its non-link state, and
deleted all directories under "/usr/share/zoneinfo" except "US". Voila
! Java worked again.

I am not sure what the proper fix is. Obviously we cannot fix the Java
library until they finally release it under GPL (which they are not
planning for 1.5). I don't know why /etc/locatime was changed to
non-link, but it doesn't make a lot of sense to file this as a bug
under libc or tzdata.

At least the workarounds should be documented:
- Set the TZ environment variable (but it can't be done globally)
- Use "-Duser.timezone=xxx"

Lastly, Sun may fix this. I will try reporting it there as well.

This problem Java software semi-unusable under Etch without
modifications, so I think it merits important severity, if not higher.

-- System Information:
Debian Release: 4.0
 APT prefers testing
 APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@ubuntu.com>:
Bug#416452; Package sun-java5-jre. (full text, mbox, link).


Acknowledgement sent to "Tzvetan Mikov" <tmikov@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@ubuntu.com>. (full text, mbox, link).


Message #10 received at 416452@bugs.debian.org (full text, mbox, reply):

From: "Tzvetan Mikov" <tmikov@gmail.com>
To: 416452@bugs.debian.org
Subject: Some more info
Date: Tue, 27 Mar 2007 20:43:58 -0700
I found the bug which caused /etc/localtime to be changed from a
symlink to a copy:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=346342

The problem which that bug addressed appears only when UTC=no and /usr
is a separate partition, so in theory in many cases changing
/etc/localtime back to a symlink should be fine. Unfortunately
tzconfig overwites the link with a copy when run. I suspect it also
does it when upgrading libc6. So, such a fix would be very dangerous -
it will revert to the broken behavior silently after a random "apt-get
upgrade".

Frankly, I am a loss about how this can be fixed from Debian. It is
pretty grave, though, because now most Java applications ran in the
pacific USA cannot work correctly under Etch without manual tweaking
(export TZ="US/Pacific").

I have submitted a bug report to Sun, but I still don't have a
reference (number, URL, etc) from them.



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@ubuntu.com>:
Bug#416452; Package sun-java5-jre. (full text, mbox, link).


Acknowledgement sent to Stephen Fitch <Stephen.Fitch@Sun.COM>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@ubuntu.com>. (full text, mbox, link).


Message #15 received at 416452@bugs.debian.org (full text, mbox, reply):

From: Stephen Fitch <Stephen.Fitch@Sun.COM>
To: 416452@bugs.debian.org, tmikov@gmail.com, Tom Marble <Tom.Marble@Sun.COM>
Cc: Stephen.Fitch@Sun.COM, Mark Susko <Mark.Susko@Sun.COM>
Subject: Debian Bug report logs - #416452
Date: Mon, 02 Apr 2007 07:13:05 -0700
Hi Tzvetan,

W.R.T...

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416452

Q. What Debian version is this with?

Q. What Olson data set is integrated into this Debian release?

Thanks.

Stephen

Java SE Engineering - Sustaining - Sun Microsystems, Inc.



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@ubuntu.com>:
Bug#416452; Package sun-java5-jre. (full text, mbox, link).


Acknowledgement sent to "Tzvetan Mikov" <tmikov@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@ubuntu.com>. (full text, mbox, link).


Message #20 received at 416452@bugs.debian.org (full text, mbox, reply):

From: "Tzvetan Mikov" <tmikov@gmail.com>
To: "Stephen Fitch" <Stephen.Fitch@sun.com>
Cc: 416452@bugs.debian.org, "Tom Marble" <Tom.Marble@sun.com>, "Mark Susko" <Mark.Susko@sun.com>
Subject: Re: Debian Bug report logs - #416452
Date: Mon, 2 Apr 2007 08:02:19 -0700
(I hit the wrong reply button, sorry - sending again to all included,
including Debian's bug tracker)

Hi Stephen,
The Debian release is 4.0 - Debian Etch. The timezone data version in
this release, as far as I can tell, is 2007b (I suppose that is what
you call an Olson dataset - I am not an expert in these things :-) )

Let me summarize the problem, as I understand it. Since I made the bug
report I have examined the JDK5 and 6 sources and confirmed the
problem more precisely.

*  JDK5 and JDK6 (the problem is present in both, I don't know about
earlier versions) detect the system timezone by relying on
"/etc/localtime" being a symbolic link. For example, if
"/etc/localtime" points to "/usr/share/zoneinfo/US/Pacific", then the
zone ID is "US/Pacific"

* In Debian Etch (and I suppose other distributions) "/etc/localtime"
is not a link. If you are interested in the motivation for this
change, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=346342 .

* When /etc/localtime is not a link, the library falls back to binary
comparison of all files under "/usr/local/share/zoneinfo" against
"/etc/localtime". It will find the first file which has the same
contents as /etc/localtime, although it may not necessarily be the
currently selected timezone. In this case it finds "SystemV/PST8PDT"
before "US/Pacific".

* In Debian based distributions the correct way to determine the
system timezone is by reading "/etc/timezone". It is a test that can
easily be added implemented before falling back to binary comparison.
I can provide a patch if necessary - the code is really simple.

* Finally, the definitions of "SystemV/PST8PDT" in Debian and JDK5 (I
haven't checked JDK6) are different. So, when using "SystemV/PST8PDT"
as a default timezone, Java displays the localtime incorrectly. I
don't know whose definition of "SystemV/PST8PDT" is correct, but that
doesn't really matter because the system timezone is not set to
"SystemV/PST8PDT".

Hope this helps. Please, let me know if you have any questions.

regards,
Tzvetan



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@ubuntu.com>:
Bug#416452; Package sun-java5-jre. (full text, mbox, link).


Acknowledgement sent to Stephen Fitch <Stephen.Fitch@Sun.COM>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@ubuntu.com>. (full text, mbox, link).


Message #25 received at 416452@bugs.debian.org (full text, mbox, reply):

From: Stephen Fitch <Stephen.Fitch@Sun.COM>
To: Tzvetan Mikov <tmikov@gmail.com>
Cc: 416452@bugs.debian.org, Tom Marble <Tom.Marble@Sun.COM>, Mark Susko <Mark.Susko@Sun.COM>, Masayoshi Okutsu <Masayoshi.Okutsu@Sun.COM>
Subject: Re: Debian Bug report logs - #416452
Date: Mon, 02 Apr 2007 08:10:18 -0700
Hi Tzvetan,

Thanks for the clarifications, and details. We are
considering the issue, etc.

Regards,

Stephen

--

Tzvetan Mikov wrote:
> (I hit the wrong reply button, sorry - sending again to all included,
> including Debian's bug tracker)
> 
> Hi Stephen,
> The Debian release is 4.0 - Debian Etch. The timezone data version in
> this release, as far as I can tell, is 2007b (I suppose that is what
> you call an Olson dataset - I am not an expert in these things :-) )
> 
> Let me summarize the problem, as I understand it. Since I made the bug
> report I have examined the JDK5 and 6 sources and confirmed the
> problem more precisely.
> 
> *  JDK5 and JDK6 (the problem is present in both, I don't know about
> earlier versions) detect the system timezone by relying on
> "/etc/localtime" being a symbolic link. For example, if
> "/etc/localtime" points to "/usr/share/zoneinfo/US/Pacific", then the
> zone ID is "US/Pacific"
> 
> * In Debian Etch (and I suppose other distributions) "/etc/localtime"
> is not a link. If you are interested in the motivation for this
> change, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=346342 .
> 
> * When /etc/localtime is not a link, the library falls back to binary
> comparison of all files under "/usr/local/share/zoneinfo" against
> "/etc/localtime". It will find the first file which has the same
> contents as /etc/localtime, although it may not necessarily be the
> currently selected timezone. In this case it finds "SystemV/PST8PDT"
> before "US/Pacific".
> 
> * In Debian based distributions the correct way to determine the
> system timezone is by reading "/etc/timezone". It is a test that can
> easily be added implemented before falling back to binary comparison.
> I can provide a patch if necessary - the code is really simple.
> 
> * Finally, the definitions of "SystemV/PST8PDT" in Debian and JDK5 (I
> haven't checked JDK6) are different. So, when using "SystemV/PST8PDT"
> as a default timezone, Java displays the localtime incorrectly. I
> don't know whose definition of "SystemV/PST8PDT" is correct, but that
> doesn't really matter because the system timezone is not set to
> "SystemV/PST8PDT".
> 
> Hope this helps. Please, let me know if you have any questions.
> 
> regards,
> Tzvetan



Information forwarded to debian-bugs-dist@lists.debian.org, DebianBugs@Linux.TopQuark.net, Matthias Klose <doko@ubuntu.com>:
Bug#416452; Package sun-java5-jre. (full text, mbox, link).


Acknowledgement sent to Paul Donohue <DebianBugs@Linux.TopQuark.net>:
Extra info received and forwarded to list. Copy sent to DebianBugs@Linux.TopQuark.net, Matthias Klose <doko@ubuntu.com>. (full text, mbox, link).


Message #30 received at 416452@bugs.debian.org (full text, mbox, reply):

From: Paul Donohue <DebianBugs@Linux.TopQuark.net>
To: Debian Bug Tracking System <416452@bugs.debian.org>
Subject: sun-java5-jre: Any updates on the timezone bug?
Date: Wed, 06 Feb 2008 18:28:24 -0500
Package: sun-java5-jre
Version: 1.5.0-14-3
Followup-For: Bug #416452

Any updates regarding this bug?

The sun-java6 packages area also affected by this bug ... I wonder if this bug should be reassigned to sun-java6, or if the bug should be duplicated on that package?

It appears that the bug has been fixed in IcedTea:
http://icedtea.classpath.org/hg/icedtea/rev/cb78e0fccf14
I'm not sure if that fix was part of the changes imported with OpenJDK b21 into IcedTea or if it was fixed in IcedTea only...

For reference, here are related bug reports on Ubuntu and SDN:
https://bugs.launchpad.net/debian/+source/sun-java5/+bug/102937
https://bugs.launchpad.net/ubuntu/+source/sun-java6/+bug/49068
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6456628

Thanks!




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@ubuntu.com>:
Bug#416452; Package sun-java5-jre. (Thu, 30 Oct 2008 16:18:03 GMT) (full text, mbox, link).


Acknowledgement sent to James Zuelow <james_zuelow@ci.juneau.ak.us>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@ubuntu.com>. (Thu, 30 Oct 2008 16:18:04 GMT) (full text, mbox, link).


Message #35 received at 416452@bugs.debian.org (full text, mbox, reply):

From: James Zuelow <james_zuelow@ci.juneau.ak.us>
To: Debian Bug Tracking System <416452@bugs.debian.org>
Subject: sun-java5-jre: Update on this bug?
Date: Thu, 30 Oct 2008 08:16:24 -0800
Package: sun-java5-jre
Version: 1.5.0-16-3
Followup-For: Bug #416452


This bug still affects the current Java installations.

The problem will temporarily go away soon, but a more permanent fix would be nice.

A temporary workaround of a debconf dialog warning the user that timezone information may not be accurate if /etc/localtime is not a symlink might 
suffice.  That way the user does not have to experience the problem and then search BTS for a fix (assuming they read the installation dialogs and understand them).

Cheers,

James

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages sun-java5-jre depends on:
ii  debconf [debconf-2.0]         1.5.22     Debian configuration management sy
ii  java-common                   0.30       Base of all Java packages
ii  locales                       2.7-15     GNU C Library: National Language (
ii  sun-java5-bin                 1.5.0-16-3 Sun Java(TM) Runtime Environment (

Versions of packages sun-java5-jre recommends:
ii  gsfonts-x11                   0.21       Make Ghostscript fonts available t
ii  java-common                   0.30       Base of all Java packages

Versions of packages sun-java5-jre suggests:
pn  sun-java5-fonts               <none>     (no description available)
pn  sun-java5-plugin | ia32-sun-j <none>     (no description available)
pn  ttf-arphic-uming              <none>     (no description available)
pn  ttf-baekmuk | ttf-unfonts | t <none>     (no description available)
pn  ttf-kochi-gothic | ttf-sazana <none>     (no description available)
pn  ttf-kochi-mincho | ttf-sazana <none>     (no description available)

-- debconf information:
* shared/accepted-sun-dlj-v1-1: true
  sun-java5-jre/jcepolicy:
  sun-java5-jre/stopthread: true
  shared/error-sun-dlj-v1-1:
* shared/present-sun-dlj-v1-1:




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@ubuntu.com>:
Bug#416452; Package sun-java5-jre. (Wed, 01 Sep 2010 01:24:03 GMT) (full text, mbox, link).


Acknowledgement sent to zsbplc@gala.net:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@ubuntu.com>. (Wed, 01 Sep 2010 01:24:03 GMT) (full text, mbox, link).


Message #40 received at 416452@bugs.debian.org (full text, mbox, reply):

From: Vickott Higgins <redoaktravelpark@amtelecom.net>
To: Undisclosed recipients: ;
Subject: Low Interest Loan.
Date: Tue, 31 Aug 2010 21:21:50 -0400 (EDT)
Get back for more details.





Reply sent to Andreas Beckmann <anbe@debian.org>:
You have taken responsibility. (Thu, 09 Apr 2015 12:57:56 GMT) (full text, mbox, link).


Notification sent to "Tzvetan Mikov" <tmikov@gmail.com>:
Bug acknowledged by developer. (Thu, 09 Apr 2015 12:57:56 GMT) (full text, mbox, link).


Message #45 received at 416452-done@bugs.debian.org (full text, mbox, reply):

From: Andreas Beckmann <anbe@debian.org>
To: 464097-done@bugs.debian.org, 402865-done@bugs.debian.org, 541153-done@bugs.debian.org, 368467-done@bugs.debian.org, 370295-done@bugs.debian.org, 384736-done@bugs.debian.org, 416452-done@bugs.debian.org, 446827-done@bugs.debian.org, 515986-done@bugs.debian.org, 382686-done@bugs.debian.org, 431981-done@bugs.debian.org, 497547-done@bugs.debian.org, 387905-done@bugs.debian.org, 431107-done@bugs.debian.org, 488366-done@bugs.debian.org, 415726-done@bugs.debian.org, 400159-done@bugs.debian.org, 402067-done@bugs.debian.org, 367623-done@bugs.debian.org, 387487-done@bugs.debian.org, 224101-done@bugs.debian.org, 400280-done@bugs.debian.org, 367445-done@bugs.debian.org, 574259-done@bugs.debian.org, 594132-done@bugs.debian.org
Subject: sun-java5 was removed from Debian/non-free long ago
Date: Thu, 09 Apr 2015 14:55:13 +0200
Version: 1.5.0-20-1+rm

The sun-java5 source package was removed from Debian/non-free in 2009,
before the squeeze release, thus closing the remaining stray bugs now.


Andreas



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 08 May 2015 07:30:56 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jan 7 23:11:31 2018; Machine Name: beach

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.