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

A nonfatal internal JIT error

XMLWordPrintable

    • generic, x86
    • generic, windows_nt



      Name: diC59631 Date: 01/19/99


      put contents below into a file call asd.java
      then javac asd.java, then java asd.
      // ************** Start of asd.java **************
      //
      // COPYRIGHT:
      //
      // THIS PRODUCT CONTAINS RESTRICTED MATERIALS OF IBM
      // 5639-D57, 25H7-912, 5697-197 (EMEA), 17H5-843 (JAPAN)
      // (C) COPYRIGHT International Business Machines Corp., 1997,1998
      // All Rights Reserved * Licensed Materials - Property of IBM
      // The source code for this program is not published or otherwise divested
      // of its trade secrets, irrespective of what has been deposited with the
      // U. S. Copyright Office.
      //

      // This code has been modified by Hany Salem (IBM Corporation) to demontrate
      // a problem found with the jdk1.1.6 and extracted from the orginal file
      // that it was found/developed in.
      // Please contact Hany Salem US TEL# (512) 838-4865 for questions.
      // email: ###@###.###

      public class asd
      {

         public static void main(String args[])

          {
            asd me = new asd();
            double d1 = -8.989897E-29;
            long l1 = Double.doubleToLongBits(d1);
            dump("Answer should be ", l1 );
            double in = Double.longBitsToDouble(0xa971f5e23b75abc9L);
            double d2 = me.mvsDoubleToIeeeDouble(in);
            long l2 = Double.doubleToLongBits(d2);
            dump("Result is ", l2 );

          }

         public double mvsDoubleToIeeeDouble(double dmvs)
          {
         double dst=0;
         long dstTemp=0;
         int x, s, f1; long f2;
         int e;

         long src = Double.doubleToLongBits(dmvs);
         x = (int) (src >> 32);

         if ((x & 0x7fffffff) == 0)
            {
            return dst; /* zero */
            }

         s = x & 0x80000000;
         e = ((x & 0x7f000000) >> 24) - 64;
         f1 = x & 0x00ffffff;
         f2 = (src & 0x00000000ffffffffL);

         if (e >= 0)
            e <<= 2;
         else
            e = -((-e) << 2);

         long fj = (((long) f1) << 32) | f2 ;
         if (fj != 0)
            while ((fj & 0x0100000000000000L) == 0)
               {
               fj <<= 1;
               e -= 1;
               }

         fj >>= 4;
         fj &= 0x000fffffffffffffL;
         if ((e += 1023) >= 2047)
            {
            dstTemp = ( ((long)s << 32) | 0x7fefffffffffffffL);
            }
         else if (e <= 0)
            {
             dstTemp = 0;
            }
         else
            {
            dstTemp = ((long)s << 32) | ((long) e << 52) | fj;
            }
      // return whoknowswhythismaskstheproblem(dstTemp);
           // Comment out next 2 lines and uncomment line above to mask problem!
           dst = Double.longBitsToDouble(dstTemp);
           return dst;
         }

         public double whoknowswhythismaskstheproblem(long dstTemp)
          { return Double.longBitsToDouble(dstTemp);
          }

         public static void dump(String str, long l)
         {
           long mask = 0xff00000000000000L;
           System.out.print(str + " " );
           for(int i = 0; i < 8 ; i++)
            {
             String s = asd.printable( (int) ((mask & l ) >> (56 - 8*i)));
             System.out.print(s+" ");
             mask >>= 8;
            }
             System.out.println();

         }
         
         static String printable( int i)
          {
           String s = "";

           char table[] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};

           s += table[ (i & 0xf0) >> 4 ];
           s += table[ (i & 0xf) ];
           return s;

          }
         

      }
      // ************** End of asd.java **************

      java asd
      Symantec Java! JustInTime Compiler Version 3.00.078(x) for JDK 1.2
      Copyright (C) 1996-98 Symantec Corporation

      Answer should be ba 1c 7d 78 8e dd 6a f2
      A nonfatal internal JIT (3.00.078(x)) error 'VCR64 - TryTemp' has occurred in :

        'asd.mvsDoubleToIeeeDouble (D)D': Interpreting method.
        Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
      i

      Result is ba 1c 7d 78 8e dd 6a f2


      (Review ID: 52830)
      ======================================================================

      Name: krT82822 Date: 07/05/99


      1. I'm trying to read a double value from a binary file. The file is
         an ESRI-shapefile (Graphic file).
         The java interpreter fails always in the same point. Trying to
         read the first double value of the data file.
      2.
      This is the 'magic' code (only interesting)


      public static final int Little = 0, Big = 1;
       public int readInt(int modo)
        {
          int result;
          if (modo == Little)
            result = ((file[offset++]&0xff) |
                      (file[offset++]&0xff)<<8 |
                      (file[offset++]&0xff)<<16 |
                      (file[offset++]&0xff)<<24);
          else
            result = ((file[offset++]&0xff)<<24 |
                      (file[offset++]&0xff)<<16 |
                      (file[offset++]&0xff)<<8 |
                      (file[offset++]&0xff));


          return result;
        }

       public double readDouble(int modo)
        {
          int i1 = readInt(modo);
          int i2 = readInt(modo);
          long l;

          if (modo == Little)
            l = ((long)(i2) << 32) + (i1 & 0xFFFFFFFFL);
          else
            l = ((long)(i1) << 32) + (i2 & 0xFFFFFFFFL);

          double d =java.lang.Double.longBitsToDouble(l);
          return d;
        }



      3.
      A nonfatal internal JIT (3.00.078(x)) error 'VCR64 - TryTemp' has occurred in :

        'javaviewer/recordset/ByteFile.readDouble (I)D': Interpreting method.
        Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
      i


      4.


      5.
      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)

      java full version "JDK-1.2-V"

      6. I think that the problem is into de java interpreter. It fails always, even
      with distint kinds of binary files.
      Old versions of jdk fails too, but they didn't show the above message. Only
      crashes and goes out of the environment.
      (Review ID: 85183)
      ======================================================================

            Unassigned Unassigned
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: