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

Regression in 1.5.0: assert(def,"since live better have reaching def")

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 5.0
    • hotspot
    • None
    • sparc
    • solaris_9

      The next test gives assert when run with -server only.

      jaberwocky% uname -a
      SunOS jaberwocky 5.9 Generic sun4u sparc SUNW,Ultra-60

      jaberwocky% cat Test.java
      /*
         java_g -server -Xcomp -XX:CompileOnly=Test Test

      */

      import java.lang.String;

      class OopTestException extends java.lang.RuntimeException {
        public OopTestException(String s) {
          super (s);
        }
      }

      class OopTest {
         public int x;
         public int y;
         public int getX() { return x; }
         public int getY() { return y; }
         public OopTest(int ii) {
           if (ii < 0) {
             throw new OopTestException("bad init value: " + ii);
           }
           x = ii;
           y = ii*2;
         }
      }

      class Oop {
         public OopTest createOopTest(int ii) { return new OopTest(ii); }
      }

      public class Test {
        static int imax = 10;
        static int y1 = -1;
        static int y2 = 1;

        private static String test(int y) {
          String msg = "";
          Oop op = new Oop();
          for (int x= 0; x<imax; x++) {
            msg = "test " + x;
            boolean caught = false;
            OopTest ot = null;
            try {
              ot = op.createOopTest(x);
            } catch(OopTestException e) {caught = true;}

            boolean result = false;
            if (caught && y<=0) { result = true; }
            if (caught && y>0) { result = false; msg += " caught failed"; }

            if (!caught) {
              result = ( ot.getX() == x && ot.getY() == x*2);
            }

            if (!result && !caught) { msg += " x: " + ot.getX() + " y: " + ot.getY(); }
            msg += '\n';
          }

          return msg;
        }

        public static void main(String args[]) {
          String s = "";
          s = test(y1);
          s = test(y2);
        }
      }

      jaberwocky% /java/re/jdk/1.5.0/latest/binaries/solaris-sparc/bin/java_g -server -Xcomp -XX:CompileOnly=Test Test
      VM option 'CompileOnly=Test'
      # To suppress the following error report, specify this argument
      # after -XX: or in .hotspotrc: SuppressErrorAt=/buildOopMap.cpp:208]
      #
      # An unexpected error has been detected by HotSpot Virtual Machine:
      #
      # Internal Error (/BUILD_AREA/jdk1.5.0/hotspot/src/share/vm/opto/buildOopMap.cpp, 208 [ Patched ]), pid=16367, tid=8
      #
      # Java VM: Java HotSpot(TM) Server VM (1.5.0-beta2-b33-debug compiled mode)
      #
      # Error: assert(def,"since live better have reaching def")
      # An error report file with more information is saved as hs_err_pid16367.log
      #
      # If you would like to submit a bug report, please visit:
      # http://java.sun.com/webapps/bugreport/crash.jsp
      #
      Current thread is 8
      Dumping core ...
      Abort
      jaberwocky% /java/re/jdk/1.4.2_03/latest/binaries/solaris-sparc/bin/java_g -server -Xcomp -XX:CompileOnly=Test Test
      VM option 'CompileOnly=Test'
      jaberwocky%


            kvn Vladimir Kozlov
            kvn Vladimir Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: