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

modena_jlib2_2/conform/c22_07/c2207602 fails on JTG 1.2 sparc and intel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 1.2.0
    • core-libs
    • None
    • sparc
    • solaris_7

      Then test modena_jlib2_2/conform/c22_07/c2207602 fails when run using the JTG 1.2 JDK. The test was run on a single processor 2.7 machine.

      modena_jlib2_2/conform/c22_07/c2207602 compile_and_execute

               JTG1.1_sparc PASS Solaris_JDK_1.1.7_05
                JTG1.1_i386 PASS Solaris_JDK_1.1.7_05
               JTG1.2_sparc FAIL Solaris_JDK_1.2_01
                JTG1.2_i386 FAIL Solaris_JDK_1.2_01
          Javasoft1.1_sparc PASS JDK1.1.7U
           Javasoft1.1_i386 FAIL JDK1.1.7U
          Javasoft1.2_sparc PASS JDK-1.2-V
           Javasoft1.2_i386 FAIL JDK-1.2-V

      Each test was run 50 times with each JDK and they all passed or failed all 50 times.

      It fails using JTG 1.2 with the following error

      Exception in thread "main" java.lang.IndexOutOfBoundsException

              at java.lang.Throwable.fillInStackTrace(Native Method)

              at java.lang.Throwable.<init>(Throwable.java:82)

              at java.lang.Exception.<init>(Exception.java:33)

              at java.lang.RuntimeException.<init>(RuntimeException.java:37)

              at java.lang.IndexOutOfBoundsException.<init>(IndexOutOfBoundsException.
      java:34)

              at java.io.StringBufferInputStream.read(Compiled Code)

              at X.f1(c2207602.java:42)

              at X.check_read(c2207602.java:53)

              at X.main(c2207602.java:58)

      On Javasoft 1.2 intel it fails with an error of

      Exception in thread "main" java.lang.IndexOutOfBoundsException

              at java.io.StringBufferInputStream.read(Compiled Code)

              at X.f1(Compiled Code)

              at X.check_read(Compiled Code)

              at X.main(Compiled Code)

      Here is the test code. To run put /net/castor.east/jtg/testbase/src/modena_jlib2_2/classes in your classpath

      /*
       * JLIB++ : The Modena JLIB++ Suite, Version 2.2, June 1998
       * Copyright (c) 1995-1998 Modena Software (I) Pvt. Ltd., All Rights Reserved
       */

      /*
       * Section : 22.7.6
       * Filename : c2207602
       * Purpose : Positive test for section 22.7.6
       *
       * public int read(byte[] b,int off, int len)
       * throws NullPointerException
       * IndexOutOfBoundsException
       *
       * If pos equals count then -1 is returned to indicate end of file
       * The number k of bytes read is equal to the smaller of len and count-pos
       * If k is positive then bytes buffer[pos] thru buffer[pos+k-1] are copied
       * in the manner performed by System.arraycopy
       */
       
       import cpack.*;
       import java.io.*;
       
       class X extends StringBufferInputStream{

        X(String str)
        {
          super(str);
        }
       
        static String s = "MODENA";
        static X ox;
       
       
        public static void f1()
        {
           int k = 0;
           byte[] b = new byte[6];
           ox = new X(s);
           
           
           k = ox.read(b,0,8);
           Chk.chkIntVal("err_1","k",k,6);
           Chk.chkIntVal("err_2","pos",ox.pos,6);
           k = ox.read(b,0,1);
           Chk.chkIntVal("err_3","k",k,-1);
        }
        
          
        
        public static void check_read()
        {
           f1();
        }
        
        public static void main(String argv[])
        {
          check_read();
          Chk.endTest("c2207602");
        }
      }

            mr Mark Reinhold
            sbohne Steve Bohne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: