JDK-8144066 : StackOverflowException when computing glb
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-11-25
  • Updated: 2017-01-17
  • Resolved: 2017-01-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b152Fixed
Related Reports
Relates :  
Relates :  
Description
The following program:

class A<T> {
  Exception[] bar(A<? super Exception[]> x, A<? super Throwable[]> y){
    return foo(x,  y);
  }

  <T> T foo(A<? super T> x, A<? super T> y){
    return null;
  }
}

Crashes with SOE:

The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
        at com.sun.tools.javac.code.Type.hasTag(Type.java:133)
        at com.sun.tools.javac.code.Types$12.visitClassType(Types.java:1928)
        at com.sun.tools.javac.code.Types$12.visitClassType(Types.java:1916)
        at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:999)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4519)
        at com.sun.tools.javac.code.Types.asSuper(Types.java:1913)
        at com.sun.tools.javac.code.Types$4.visitClassType(Types.java:919)
        at com.sun.tools.javac.code.Types$4.visitClassType(Types.java:840)
        at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:999)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4519)
        at com.sun.tools.javac.code.Types.isSubtype(Types.java:836)
        at com.sun.tools.javac.code.Types.isSubtypeNoCapture(Types.java:810)
        at com.sun.tools.javac.code.Types$4.visitType(Types.java:854)
        at com.sun.tools.javac.code.Types$4.visitType(Types.java:840)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visitTypeVar(Types.java:4525)
        at com.sun.tools.javac.code.Types$SimpleVisitor.visitCapturedType(Types.java:4570)
        at com.sun.tools.javac.code.Type$CapturedType.accept(Type.java:1696)
        at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4519)
        at com.sun.tools.javac.code.Types.isSubtype(Types.java:836)
        at com.sun.tools.javac.code.Types.isSubtypeNoCapture(Types.java:810)
        at com.sun.tools.javac.code.Types.closureMin(Types.java:3561)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3752)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
        at com.sun.tools.javac.code.Types.glbFlattened(Types.java:3773)
...
Comments
Spec here is a problem, because we need the glb of two lower-bounded capture variables. See JDK-8039222.
16-12-2016

Confirmed, crash was introduced by JDK-8033718.
10-12-2015

This started in jdk9-b13 - so I'm assuming it's related to JDK-8033718.
25-11-2015