Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4464956

JCK1.4: client VM: invalid optimizations, linux, windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • hotspot
    • beta2
    • x86
    • generic, linux, windows_98
    • Verified



      Name: asR10013 Date: 06/01/2001



      JDK : jdk1.4.0-beta-b66
      JCK : jck1.4
      Platform[s] : RedHat linux 6.2, Windows 98
      switch/Mode : -Xmixed -Xfuture, -Xcomp -Xfuture
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test :
      api/java_sql/Timestamp/descriptions.html#Before
      api/java_sql/Timestamp/descriptions.html#After

      Test source location:
      =====================
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/java_sql/Timestamp/BeforeTests.java
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/java_sql/Timestamp/AfterTests.java

      jtr file location:
      ==================
      /net/jtgb4u4c.eng/export/sail7/JavaWebServer1.1.3/public_html/QA/merlin/b66jck14/linux/redhat6.2_smp_gnome_client_linux-6/workDir/api/java_sql/Timestamp/descriptions_Before.jtr
      /net/jtgb4u4c.eng/export/sail7/JavaWebServer1.1.3/public_html/QA/merlin/b66jck14/linux/redhat6.2_smp_gnome_client_linux-6/workDir/api/java_sql/Timestamp/descriptions_After.jtr

      How to reproduce:
      ====================
          The following code is based on BeforeTests.java
      Compile and execute it.
          The problem occurs only in Client VM mixed or compiled mode.
      During loop Timestamp constructor is optimized incorrectly,
      so next time it is invoked unexpected Timestamp objects
      are produced. (They all should be different).

      ------------------ test.java start ------------------------------
      import java.sql.*;
      class test {
          public static void main(String args[]) {

      java.util.Random r = new java.util.Random();
      // loop is important!
      for (int i=1; i<20000; i++) {
      Timestamp st1 = new Timestamp(r.nextInt());
      }
      Timestamp ts1 = new Timestamp(1234560000); //step Create Timestamp
              System.out.println("ts1 = " + ts1);
              Timestamp ts2 = new Timestamp(1234567000); //step Create Timestamp
              System.out.println("ts2 = " + ts2);
              Timestamp ts3 = new Timestamp(1234569000); //step Create Timestamp
              System.out.println("ts3 = " + ts3);
              if (!(ts1.before(ts2) && ts2.before(ts3) && ts1.before(ts3) ))
      System.err.println("Failed");

          }
      }
      ------------------ test.java end ------------------------------

      Test output:
      =============
      Timestamp2008: Failed. Failed
      ====== Timestamp2008 ======
      ts1 = 1970-01-01 07:00:01.0
      ts2 = 1970-01-01 07:00:01.0
      ts3 = 1970-01-01 07:00:01.0

      Specific Machine Info:
      =====================
      Hostname: linux-16
      Os: Windows98
      Hostname : linux-12
      Os: RedHat 6.2

      ======================================================================

            never Tom Rodriguez
            alssunw Als Als (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: