Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackOverflowError with raw type in intersection bound #3994

Closed
cushon opened this issue Dec 11, 2020 · 0 comments · Fixed by #4039
Closed

StackOverflowError with raw type in intersection bound #3994

cushon opened this issue Dec 11, 2020 · 0 comments · Fixed by #4039
Assignees
Labels
Milestone

Comments

@cushon
Copy link
Contributor

cushon commented Dec 11, 2020

The following example, which contains a raw type in an intersection type bound, causes the Checker Framework to run out of stack. I tried increasing the stack limit to -Xss10m and got the same StackOverflowError.

class T {
  interface V {}
  interface H<T extends V & H> {}
}
./checker-framework-3.8.0/checker/bin/javac -processor Nullness T.java
error: SourceChecker.typeProcess: unexpected Throwable (StackOverflowError) while processing T.java
  ; The Checker Framework crashed.  Please report the crash.
  Compilation unit: T.java
  Last visited tree at line 1 column 1:
  abstract class T {
  Exception: java.lang.StackOverflowError; java.lang.StackOverflowError
        at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1327)
        at jdk.compiler/com.sun.tools.javac.code.Symbol.apiComplete(Symbol.java:649)
        at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.getKind(Type.java:1145)
        at jdk.compiler/com.sun.tools.javac.model.JavacTypes.getWildcardType(JavacTypes.java:223)
        at org.checkerframework.framework.type.BoundsInitializer.getUpperBoundAsWildcard(BoundsInitializer.java:142)
        at org.checkerframework.framework.type.BoundsInitializer.access$300(BoundsInitializer.java:46)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.getJavaType(BoundsInitializer.java:685)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.initializeTypeArgs(BoundsInitializer.java:626)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.visitDeclared(BoundsInitializer.java:360)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.visitDeclared(BoundsInitializer.java:278)
        at org.checkerframework.framework.type.AnnotatedTypeMirror$AnnotatedDeclaredType.accept(AnnotatedTypeMirror.java:907)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.visit(BoundsInitializer.java:348)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.visitIntersection(BoundsInitializer.java:382)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.visitIntersection(BoundsInitializer.java:278)
        at org.checkerframework.framework.type.AnnotatedTypeMirror$AnnotatedIntersectionType.accept(AnnotatedTypeMirror.java:2100)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.visit(BoundsInitializer.java:348)
        at org.checkerframework.framework.type.BoundsInitializer$InitializerVisitor.initializeUpperBound(BoundsInitializer.java:526)
        at org.checkerframework.framework.type.BoundsInitializer.initializeBounds(BoundsInitializer.java:178)
        at org.checkerframework.framework.type.BoundsInitializer.initializeTypeArgs(BoundsInitializer.java:117)
        at org.checkerframework.framework.type.AnnotatedTypeMirror$AnnotatedDeclaredType.getTypeArguments(AnnotatedTypeMirror.java:962)
        at org.checkerframework.framework.util.element.TypeDeclarationApplier.extractAndApply(TypeDeclarationApplier.java:121)
        at org.checkerframework.framework.util.element.TypeDeclarationApplier.apply(TypeDeclarationApplier.java:23)
        at org.checkerframework.framework.type.ElementAnnotationApplier.applyInternal(ElementAnnotationApplier.java:132)
        at org.checkerframework.framework.type.ElementAnnotationApplier.apply(ElementAnnotationApplier.java:78)
        at org.checkerframework.framework.type.TypeFromClassVisitor.visitClass(TypeFromClassVisitor.java:19)
        at org.checkerframework.framework.type.TypeFromClassVisitor.visitClass(TypeFromClassVisitor.java:12)
@smillst smillst self-assigned this Dec 14, 2020
@smillst smillst added the crash label Dec 14, 2020
@smillst smillst added this to the Critical milestone Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants