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

execution of expr05001 is not stable

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.2fcs
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description



      Name: ngC57085 Date: 05/18/98


      The test lang/EXPR/expr050/expr05001 is successfully compiled and
      sometimes its execution is not successful. If execute this test in
      a loop the next result may be found.

      > java -version
      java version "1.2beta4"
      Classic VM (build JDK-1.2beta4-F, green threads, sunwjit)
      > javac -d . expr05001.java
      > foreach n ( 1 2 3 4 5 6 7 8 9 10 )
      ? echo $n
      ? java -verify javasoft.sqe.tests.lang.expr050.expr05001.expr05001
      ? end
      1
      Default value is used: 1000000000
      java.lang.OutOfMemoryError: javasoft.sqe.tests.lang.expr050.expr05001.Record
      i=113
      j=0
      2
      Default value is used: 1000000000
      Exception in thread "main" java.lang.NullPointerException
      at java.lang.System.arraycopy(Native Method)
      at java.lang.String.getChars(Compiled Code)
      at java.lang.StringBuffer.append(Compiled Code)
      at java.lang.Throwable.toString(Compiled Code)
      at java.lang.String.valueOf(Compiled Code)
      at java.io.PrintStream.print(Compiled Code)
      at java.io.PrintStream.println(Compiled Code)
      at javasoft.sqe.tests.lang.expr050.expr05001.expr05001.run(Compiled Code)
      at javasoft.sqe.tests.lang.expr050.expr05001.expr05001.main(Compiled Code)
      3
      Default value is used: 1000000000
      java.lang.OutOfMemoryError: javasoft.sqe.tests.lang.expr050.expr05001.Record
      i=46
      j=0
      4
      Default value is used: 1000000000
      java.lang.OutOfMemoryError: javasoft.sqe.tests.lang.expr050.expr05001.Record
      i=53
      j=0
      5
      Default value is used: 1000000000
      Exception in thread "main" java.lang.NullPointerException
      at java.lang.System.arraycopy(Native Method)
      at java.lang.String.getChars(Compiled Code)
      at java.lang.StringBuffer.append(Compiled Code)
      at java.lang.Throwable.toString(Compiled Code)
      at java.lang.String.valueOf(Compiled Code)
      at java.io.PrintStream.print(Compiled Code)
      at java.io.PrintStream.println(Compiled Code)
      at javasoft.sqe.tests.lang.expr050.expr05001.expr05001.run(Compiled Code)
      at javasoft.sqe.tests.lang.expr050.expr05001.expr05001.main(Compiled Code)
      6
      Default value is used: 1000000000
      java.lang.OutOfMemoryError: javasoft.sqe.tests.lang.expr050.expr05001.Record
      i=122
      j=0
      7
      Default value is used: 1000000000
      Exception in thread "main" java.lang.NullPointerException
      at java.lang.System.arraycopy(Native Method)
      at java.lang.String.getChars(Compiled Code)
      at java.lang.StringBuffer.append(Compiled Code)
      at java.lang.Throwable.toString(Compiled Code)
      at java.lang.String.valueOf(Compiled Code)
      at java.io.PrintStream.print(Compiled Code)
      at java.io.PrintStream.println(Compiled Code)
      at javasoft.sqe.tests.lang.expr050.expr05001.expr05001.run(Compiled Code)
      at javasoft.sqe.tests.lang.expr050.expr05001.expr05001.main(Compiled Code)
      8
      Default value is used: 1000000000
      java.lang.OutOfMemoryError
      i=125
      j=1
      9
      Default value is used: 1000000000
      java.lang.OutOfMemoryError: javasoft.sqe.tests.lang.expr050.expr05001.Record
      i=124
      j=0
      10
      Default value is used: 1000000000
      java.lang.OutOfMemoryError
      i=38
      j=1
      >

      Some runs were failed because of java.lang.NullPointerException occured during
      test execution.

      ------------------ expr05001.java ------------------
      // Ident: @(#)expr05001.java 1.3 97/08/01
      // Copyright 08/01/97 Sun Microsystems, Inc. All Rights Reserved
      package javasoft.sqe.tests.lang.expr050.expr05001;



      import java.io.PrintStream;
      import java.lang.OutOfMemoryError;


      class Record
      {
      public double f01, f02, f03, f04, f05, f06, f07, f08, f09, f10;
      public double f11, f12, f13, f14, f15, f16, f17, f18, f19, f20;
      public double f21, f22, f23, f24, f25, f26, f27, f28, f29, f30;
      public double f31, f32, f33, f34, f35, f36, f37, f38, f39, f40;
      public double f41, f42, f43, f44, f45, f46, f47, f48, f49, f50;
      public double f51, f52, f53, f54, f55, f56, f57, f58, f59, f60;
      public double f61, f62, f63, f64, f65, f66, f67, f68, f69, f70;
      public double f71, f72, f73, f74, f75, f76, f77, f78, f79, f80;
      public double f81, f82, f83, f84, f85, f86, f87, f88, f89, f90;
      public double f91, f92, f93, f94, f95, f96, f97, f98, f99, f00;
      }


      public class expr05001
      {
        public static void main(String args[])
      {
      System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
      }
       
      static int arg = 1000000000;
      static int errorStatus = 0/*STATUS_PASSED*/;

      static void errorAlert(PrintStream out, int errorLevel) {
      out.println("expr05001: failure #" + errorLevel);
      errorStatus = 2/*STATUS_FAILED*/;
      }

      public static int run(String args[], PrintStream out)
      {
      int lim1 = 10000;
      int lim2 = 100000;
      int len;
      int i = -1;
      int j = -1;
      int res = 0;
      int param = get_arg (args, out);
      int [][][] a = new int [lim1][][];
      Record [] x = new Record [lim2];

      len = arg;
      for (i = 0; i < lim1; i++) {
      try {
      a[i] = new int [len][len];
      } catch (OutOfMemoryError e) {
      if (len > 20)
      len /= 2;
      else
      break;
      }
      }
      try {
      for (j = 0; j < lim2; j++){
      x[j] = new Record();
      }
      } catch (OutOfMemoryError e) {
      a = null;
      x = null;
      out.println(e);
      out.println("i="+i);
      out.println("j="+j);
      return 0/*STATUS_PASSED*/;
      }
      a = null;
      x = null;
      out.println("len="+len);
      out.println("i="+i);
      out.println("j="+j);
      if ( param == 0 ) {
      out.println("OutOfMemoryError was not occured");
      return 0/*STATUS_PASSED*/;
      }
      return 2/*STATUS_FAILED*/;
      }

      static int get_arg (String argv[],PrintStream out) {
      int res = expr05001.arg;
      L: if ( argv.length != 0 ) {
      try {
      int param = new Integer(argv[0]).intValue();
      if ( param >= 0 ) {
      out.println("Integer execute argument: " + param);
      if ( param > 0 ) {
      expr05001.arg = param;
      return param;
      }
      res = param;
      break L;
      }
               }
        catch (Exception e) {
      out.println(e);
      }
      out.println("Incorrect integer execute argument: " + argv[0]);
      }
      out.println("Default value is used: " + expr05001.arg);
      return res;
      }
      }

      ----------------------------------------------------

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

        Attachments

          Activity

            People

            Assignee:
            apalanissunw Anand Palaniswamy (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: