← Back to team overview

openjdk team mailing list archive

[Bug 1859217] [NEW] openjdk8 update 8u232-b09-0ubuntu1~18.04.1 breaks Timestamp values for timezones that change DST observance

 

Public bug reported:

The testcase showing the issue:

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
public class TZTest {
    public static void main(String args[]) {
        TimeZone tz = TimeZone.getTimeZone("Europe/Istanbul");
        TimeZone.setDefault(tz);
        GregorianCalendar gc = new GregorianCalendar(1943, 00, 01, 12, 01, 01);
        gc.add(Calendar.MILLISECOND, 123);
        System.out.println(System.getProperty("java.version") + "->" + gc.getTimeInMillis());
    }
}

The output for 1.8 and 11.0 is:
1.8.0_232->-852044338877
11.0.5   ->-852040738877

note that there is one hour worth of difference between the two values.
The value reported in 11.0.5 is the correct one (or, at least, the one
that is compatible with all other jdk versions). You have to compile and
execute the code with the same version for the issue to happen, i.e.
compile with 1.8 and execute with 1.8 and then compile with 11 and
execute with 11

As far as I know, Europe/Instanbul kept changing the DST observance
rules. GregorianCalendar::getTimeInMillis() seems to be broken around
all the changes I've tested with:

1943-01-01 12:01:01.123
1963-01-01 12:01:01.123
1979-01-01 12:01:01.123
1985-01-01 12:01:01.123

The upgrade happened on the 18th of December:
Start-Date: 2019-12-18  06:16:01
Commandline: /usr/bin/unattended-upgrade
Upgrade: openjdk-8-jdk-headless:amd64 (8u222-b10-1ubuntu1~18.04.1, 8u232-b09-0ubuntu1~18.04.1), openjdk-8-jre-headless:amd64 (8u222-b10-1ubuntu1~18.04.1, 8u232-b09-0ubuntu1~18.04.1)
End-Date: 2019-12-18  06:16:23

Applications using this patch will observe wrong data with unknown
consequences.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: openjdk-8-jdk 8u232-b09-0ubuntu1~18.04.1
ProcVersionSignature: Ubuntu 4.15.0-1065.75-oem 4.15.18
Uname: Linux 4.15.0-1065-oem x86_64
NonfreeKernelModules: lkp_Ubuntu_4_15_0_1065_75_oem_61 nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7.9
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Jan 10 16:53:07 2020
InstallationDate: Installed on 2019-12-18 (23 days ago)
InstallationMedia: Ubuntu 18.04 "Bionic" - Build amd64 LIVE Binary 20180608-09:38
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_IE.UTF-8
 SHELL=/bin/bash
SourcePackage: openjdk-8
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: openjdk-8 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug bionic

-- 
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-8 in Ubuntu.
https://bugs.launchpad.net/bugs/1859217

Title:
  openjdk8 update 8u232-b09-0ubuntu1~18.04.1 breaks Timestamp values for
  timezones that change DST observance

Status in openjdk-8 package in Ubuntu:
  New

Bug description:
  The testcase showing the issue:

  import java.util.Calendar;
  import java.util.GregorianCalendar;
  import java.util.TimeZone;
  public class TZTest {
      public static void main(String args[]) {
          TimeZone tz = TimeZone.getTimeZone("Europe/Istanbul");
          TimeZone.setDefault(tz);
          GregorianCalendar gc = new GregorianCalendar(1943, 00, 01, 12, 01, 01);
          gc.add(Calendar.MILLISECOND, 123);
          System.out.println(System.getProperty("java.version") + "->" + gc.getTimeInMillis());
      }
  }

  The output for 1.8 and 11.0 is:
  1.8.0_232->-852044338877
  11.0.5   ->-852040738877

  note that there is one hour worth of difference between the two
  values. The value reported in 11.0.5 is the correct one (or, at least,
  the one that is compatible with all other jdk versions). You have to
  compile and execute the code with the same version for the issue to
  happen, i.e. compile with 1.8 and execute with 1.8 and then compile
  with 11 and execute with 11

  As far as I know, Europe/Instanbul kept changing the DST observance
  rules. GregorianCalendar::getTimeInMillis() seems to be broken around
  all the changes I've tested with:

  1943-01-01 12:01:01.123
  1963-01-01 12:01:01.123
  1979-01-01 12:01:01.123
  1985-01-01 12:01:01.123

  The upgrade happened on the 18th of December:
  Start-Date: 2019-12-18  06:16:01
  Commandline: /usr/bin/unattended-upgrade
  Upgrade: openjdk-8-jdk-headless:amd64 (8u222-b10-1ubuntu1~18.04.1, 8u232-b09-0ubuntu1~18.04.1), openjdk-8-jre-headless:amd64 (8u222-b10-1ubuntu1~18.04.1, 8u232-b09-0ubuntu1~18.04.1)
  End-Date: 2019-12-18  06:16:23

  Applications using this patch will observe wrong data with unknown
  consequences.

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: openjdk-8-jdk 8u232-b09-0ubuntu1~18.04.1
  ProcVersionSignature: Ubuntu 4.15.0-1065.75-oem 4.15.18
  Uname: Linux 4.15.0-1065-oem x86_64
  NonfreeKernelModules: lkp_Ubuntu_4_15_0_1065_75_oem_61 nvidia_modeset nvidia
  ApportVersion: 2.20.9-0ubuntu7.9
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Fri Jan 10 16:53:07 2020
  InstallationDate: Installed on 2019-12-18 (23 days ago)
  InstallationMedia: Ubuntu 18.04 "Bionic" - Build amd64 LIVE Binary 20180608-09:38
  ProcEnviron:
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_IE.UTF-8
   SHELL=/bin/bash
  SourcePackage: openjdk-8
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1859217/+subscriptions


Follow ups