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

Deep recursion exhausts stack when compiling large array initializer

XMLWordPrintable

    • beta
    • generic, sparc
    • generic, solaris_7
    • Verified



      Name: ngR10089 Date: 08/18/2000



      Java compiler jdk1.4.0beta-b28 failed when compile JCK-122 test
      tests/lang/ARR/arr020/arr02005m4/arr02005m4.java
      on solaris on Ultra-1:

      > java -version
      java version "1.4.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b28)
      Java HotSpot(TM) Core VM (build 1.3-internal, interpreted mode)
      > javac -d /tmp arr02005m4.java
      An exception has occurred in the compiler (1.4.0beta). Please file a bug at the Java
      Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the
      Bug Parade for duplicates. Include your program and the following diagnostic in your
      report. Thank you.
      java.lang.StackOverflowError
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:63)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
                      . . .
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      at com.sun.tools.javac.v8.util.Hashtable.copy(Hashtable.java:64)
      >

      If the test is compiled by jdk1.4.0beta-b28 on solaris on SS-20 or
      on WindowsNT, the compilation is successful.

      Note, that javac from jdk1.4.0beta-b22 successfully compiles this test.


       Justification:
      This bug causes JCK test regression.

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

      ==============================
      FILE /gafter/gjc-neal/src/share/javac/com/sun/tools/javac/v8/util/SCCS/../Hashtable.java
      ==============================

      ------- Hashtable.java -------
      *** /tmp/dfvaWn0 Thu Dec 7 11:45:59 2000
      --- Hashtable.java Wed Dec 6 13:44:52 2000
      ***************
      *** 66,75 ****
            }
        
            private void copy(Entry<Key,Data> e) {
      ! if (e != null) {
      ! copy(e.next);
      ! e.next = table[e.hash & hashMask];
      ! table[e.hash & hashMask] = e;
              }
            }
        
      --- 66,77 ----
            }
        
            private void copy(Entry<Key,Data> e) {
      ! while (e != null) {
      ! Entry<Key,Data> next = e.next;
      ! int i = e.hash & hashMask;
      ! e.next = table[i];
      ! table[i] = e;
      ! e = next;
              }
            }
        


      neal.gafter@Eng 2000-12-07

            gafter Neal Gafter (Inactive)
            nvgsunw Nvg Nvg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: