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

Bad exception in trivial loop on Sparc 32b -server

XMLWordPrintable

    • 04
    • generic, sparc
    • solaris_2.5.1, solaris_7

        This program:

        class A {
         public static void main(String argv[]) {
            
            int size = 4000000;
            int x[] = new int[size];
            
            for (int i = 0; i < 1000; i++) {
              for (int j = 0; j < size; j += 8192) {
                int y = x[j];
              }
            }
          }
        }

        Fails as follows:

        mate:~> /usr/local/java/jdk1.4.0/solsparc/bin/java A
        mate:~> /usr/local/java/jdk1.4.0/solsparc/bin/java -server A
        Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
                at A.main(A.java:9)
        mate:~> /usr/local/java/jdk1.4.0/solsparc/bin/java -server -Xint A
        mate:~> /usr/local/java/jdk1.4.0/solsparc/bin/java -d64 A
        mate:~> /usr/local/java/jdk1.4.0/solsparc/bin/java -server -XX:+PrintCompilation A
          1% A::main @ 18
         (47 bytes)
        Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
                at A.main(A.java:9)
        mate:~> /usr/local/java/jdk1.4.0/solsparc/bin/java -server -version
        java version "1.4.0-rc"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b91)
        Java HotSpot(TM) Server VM (build 1.4.0-rc-b91, mixed mode)

        It does not fail in 1.3.1 or 1.2.1.

              busersunw Btplusnull User (Inactive)
              dstoutamsunw David Stoutamire (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: