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

javac crashes with StackOverflowError

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6u1
    • Fix Version/s: 7
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b39
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Description

      I have a non-trivial source tree that crashes javac with the following stack trace:

      The system is out of resources.
      Consult the following stack trace for details.
      java.lang.StackOverflowError
              at com.sun.tools.javac.code.Type$WildcardType.accept(Type.java:415)
              at com.sun.tools.javac.code.Types$MapVisitor.visit(Types.java:3214)
              at com.sun.tools.javac.code.Types.upperBound(Types.java:95)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
              at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
              at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
              at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
              at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
              at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)
              at com.sun.tools.javac.code.Types.adapt(Types.java:2998)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2959)
              at com.sun.tools.javac.code.Types.adaptRecursive(Types.java:2968)

      This happens with the following java versoin on Linux:

        : java -fullversion
        java full version "1.6.0_01-b06"

      If this can be fixed w/o a test case, that would be wonderful, but otherwise to produce a test case I need to identify which part of the source file is causing this problem. Is there anyway to run javac with some sort of debug flag so that I can figure out which source file is failing to compile? I think that is necessary for me to come up with a smaller test case.
      Here's a very small test case:

      class A<T extends A<?>> {}
      class B extends A<A<?>> {}

      class Test {
          A<A<?>> t = null;
          B c = (B)t;
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mcimadamore Maurizio Cimadamore
              Reporter:
              kkawagucsunw Kohsuke Kawaguchi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: