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

deoptimization at goto bytecode resumes execution at wrong bytecode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • hotspot
    • None
    • beta2
    • sparc
    • solaris_8

      Beoptimization at a goto or goto_w bytecode may result in incorrect execution or a crash because execution is resumed at the wrong bci. Here's a test case.

      public class bw implements Runnable {
        public void run() {
          for (int i = 0; i < 50; i++) {
            try {
              System.gc();
              Thread.sleep(50);
            } catch (Exception e) {
            }
          }
          System.exit(0);
        }

        static int iters = 10000;
        public static void main(String[] args) {
          Thread t = new Thread(new bw());
          t.start();
          test(iters);
        }
        public static void test(int limit) {
          int i = 0;
          while (true) {
            double f = 32923849234.9;
            double f1 = f * f * f;
            i++;
          }
        }
      }


      Running it as follows will cause a crash:

      /usr/local/java/jdk1.4/solsparc/bin/java_g -XX:CompileOnly=bw -Xcomp -XX:+DeoptimizeALot bw


      thomas.rodriguez@eng 2001-06-28

            never Tom Rodriguez
            never Tom Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: