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

java.lang.StackOverflowError for cyclic inheritance

XMLWordPrintable

    • hopper
    • x86, sparc
    • solaris_8, windows_2000
    • Verified

      Here is a simplified test case:

      frog:/net/frog/gafter/gjc-work/4500240.ws/4497044/test $ cat -n A.java
           1 interface B {}
           2 class A implements B {}
      frog:/net/frog/gafter/gjc-work/4500240.ws/4497044/test $ cat -n B.java
           1 class B extends A {
           2 class X extends Y {}
           3 }
      frog:/net/frog/gafter/gjc-work/4500240.ws/4497044/test $ /usr/local/java/jdk1.4/solsparc/bin/javac A.java
      frog:/net/frog/gafter/gjc-work/4500240.ws/4497044/test $ /usr/local/java/jdk1.4/solsparc/bin/javac B.java 2>&1 | head -20
      An exception has occurred in the compiler (1.4.0-beta3). 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.comp.Resolve.findMemberType(Resolve.java:502)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
      frog:/net/frog/gafter/gjc-work/4500240.ws/4497044/test $

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

       StackOverflowError while compiling a simple corba program

      /usr/local/java/jdk1.4/solsparc/bin/javac -classpath .:./tests/public_html -d . Server.java
      An exception has occurred in the compiler (1.4.0-beta2). 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.comp.Resolve.findMemberType(Resolve.java:502)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)

      to reproduce the problem extract the attached test
      to run the test
      "make all"

      this seems to be a problem with a duplicate class name in Server.java
           
           7 class Test extends _TestImplBase {
           
      an interface by Test is already defined in codebase.idl

        ****************************************************************

      the error can be reproduced by running the test from the Makefile.

      kokuho:/home/sm122304/temp/standalone/runtime 65 % ls
      ./ CatImpl.java Server.java
      ../ Makefile codebase.idl
      kokuho:/home/sm122304/temp/standalone/runtime 66 % make all
      rm -rf tests orb.db
      mkdir -p ./tests/public_html
      /usr/local/java/jdk1.4/solsparc/bin/idlj -fall -oldImplBase -td . codebase.idl
      /usr/local/java/jdk1.4/solsparc/bin/javac -classpath .:./tests/public_html -d . CatImpl.java
      /usr/local/java/jdk1.4/solsparc/bin/javac -classpath .:./tests/public_html -d . tests/*.java
      /usr/local/java/jdk1.4/solsparc/bin/javac -classpath .:./tests/public_html -d . Server.java
      An exception has occurred in the compiler (1.4.0-beta2). 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.comp.Resolve.findMemberType(Resolve.java:502)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)

      ***************************************************************************


      ###@###.### 2001-09-24

      to reproduce the problem save the attachment runtime-new.tar.Z

      bash-2.03$ ls -l
      total 48
      -rw-r--r-- 1 sony green 23612 Sep 24 10:49 runtime-new.tar.Z
      bash-2.03$ gunzip runtime-new.tar.Z
      bash-2.03$ tar -xvf runtime-new.tar
      x runtime, 0 bytes, 0 tape blocks
      x runtime/codebase.idl, 148 bytes, 1 tape blocks
      x runtime/Makefile, 632 bytes, 2 tape blocks
      x runtime/Server.java, 696 bytes, 2 tape blocks
      x runtime/CatImpl.java, 348 bytes, 1 tape blocks
      x runtime/tests, 0 bytes, 0 tape blocks
      x runtime/tests/public_html, 0 bytes, 0 tape blocks
      x runtime/tests/AnimalHelper.java, 1865 bytes, 4 tape blocks
      x runtime/tests/AnimalHolder.java, 729 bytes, 2 tape blocks
      x runtime/tests/AnimalDefaultFactory.java, 416 bytes, 1 tape blocks
      x runtime/tests/Animal.java, 705 bytes, 2 tape blocks
      x runtime/tests/CatHelper.java, 1860 bytes, 4 tape blocks
      x runtime/tests/CatHolder.java, 702 bytes, 2 tape blocks
      x runtime/tests/CatDefaultFactory.java, 407 bytes, 1 tape blocks
      x runtime/tests/Cat.java, 681 bytes, 2 tape blocks
      x runtime/tests/_TestImplBase.java, 1690 bytes, 4 tape blocks
      x runtime/tests/_TestStub.java, 1820 bytes, 4 tape blocks
      x runtime/tests/TestHolder.java, 711 bytes, 2 tape blocks
      x runtime/tests/TestHelper.java, 1773 bytes, 4 tape blocks
      x runtime/tests/Test.java, 300 bytes, 1 tape blocks
      x runtime/tests/TestOperations.java, 288 bytes, 1 tape blocks
      x runtime/tests/AnimalImpl.class, 407 bytes, 1 tape blocks
      x runtime/tests/Animal.class, 801 bytes, 2 tape blocks
      x runtime/tests/CatImpl.class, 398 bytes, 1 tape blocks
      x runtime/tests/Cat.class, 765 bytes, 2 tape blocks
      x runtime/tests/AnimalHelper.class, 2579 bytes, 6 tape blocks
      x runtime/tests/CatHelper.class, 2583 bytes, 6 tape blocks
      x runtime/tests/AnimalDefaultFactory.class, 523 bytes, 2 tape blocks
      x runtime/tests/AnimalHolder.class, 857 bytes, 2 tape blocks
      x runtime/tests/CatDefaultFactory.class, 514 bytes, 2 tape blocks
      x runtime/tests/CatHolder.class, 836 bytes, 2 tape blocks
      x runtime/tests/Test.class, 191 bytes, 1 tape blocks
      x runtime/tests/TestOperations.class, 167 bytes, 1 tape blocks
      x runtime/tests/TestHelper.class, 2654 bytes, 6 tape blocks
      x runtime/tests/TestHolder.class, 843 bytes, 2 tape blocks
      x runtime/tests/_TestImplBase.class, 1783 bytes, 4 tape blocks
      x runtime/tests/_TestStub.class, 2292 bytes, 5 tape blocks
      x runtime/run.sh, 124 bytes, 1 tape blocks
      x runtime/run.err, 76365 bytes, 150 tape blocks
      bash-2.03$ cd runtime
      bash-2.03$ ls -l
      total 162
      -rwxr--r-- 1 sony green 348 Aug 28 10:55 CatImpl.java
      -rwxr--r-- 1 sony green 632 Sep 24 10:38 Makefile
      -rwxr--r-- 1 sony green 696 Aug 28 10:55 Server.java
      -rwxr--r-- 1 sony green 148 Aug 28 10:55 codebase.idl
      -rw-r--r-- 1 sony green 76365 Sep 24 10:42 run.err
      -rwxr-xr-x 1 sony green 124 Sep 24 10:40 run.sh
      drwxr-xr-x 3 sony green 1024 Sep 24 10:38 tests
      bash-2.03$ cat run.sh
      #!/bin/sh

      /java/re/jdk/1.4.0/promoted/latest/binaries/solsparc/bin/javac -classpath .:./tests/public_html -d . Server.java
      bash-2.03$ ./run.sh
      An exception has occurred in the compiler (1.4.0-beta3). 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.comp.Resolve.findMemberType(Resolve.java:502)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:514)
              at com.sun.tools.javac.v8.comp.Resolve.findMemberType(Resolve.java:520)




            gafter Neal Gafter (Inactive)
            smanuel Sony Manuel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: