Skip to content

HandleWildcardGenerics: java.lang.StackOverflowError #1842

Closed

Description

@estekhin

The failure is reproducible with our project, but i don't know how to detect the class that causes it.
I have tried to build the project with javac -verbose, which prints a lot of checking ... and loading ... lines, but it is still not obvious what class causes the stack overflow.

If you have any suggestions on how to find the exact class/code that causes javac failure, i can rerun the build to try to isolate the issue.

An exception has occurred in the compiler (26.0.2.1). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.StackOverflowError
	at com.uber.nullaway.CodeAnnotationInfo.instance(CodeAnnotationInfo.java:63)
	at com.uber.nullaway.generics.GenericsUtils.fromUnannotatedMethodOrClass(GenericsUtils.java:168)
	at com.uber.nullaway.generics.GenericsUtils.upperBoundIsNullable(GenericsUtils.java:125)
	at com.uber.nullaway.generics.GenericsUtils.wildcardUpperBound(GenericsUtils.java:98)
	at com.uber.nullaway.generics.GenericsUtils.wildcardUpperBound(GenericsUtils.java:62)
	at com.uber.nullaway.generics.GenericsUtils.effectiveWildcardUpperBound(GenericsUtils.java:53)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.constrainContainedByWildcard(ConstraintSolverImpl.java:216)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.constrainTypeArgumentContainment(ConstraintSolverImpl.java:186)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.visitClassType(ConstraintSolverImpl.java:128)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.visitClassType(ConstraintSolverImpl.java:83)
	at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.accept(Type.java:1056)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.constrainContainedByWildcard(ConstraintSolverImpl.java:217)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.constrainTypeArgumentContainment(ConstraintSolverImpl.java:186)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.visitClassType(ConstraintSolverImpl.java:128)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.visitClassType(ConstraintSolverImpl.java:83)
	at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.accept(Type.java:1056)

with the following frames repeating ad infinitum

	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.constrainContainedByWildcard(ConstraintSolverImpl.java:217)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.constrainTypeArgumentContainment(ConstraintSolverImpl.java:186)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.visitClassType(ConstraintSolverImpl.java:128)
	at com.uber.nullaway.generics.ConstraintSolverImpl$AddSubtypeConstraintsVisitor.visitClassType(ConstraintSolverImpl.java:83)
	at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.accept(Type.java:1056)

jdk 26.0.2.1
maven 3.9.16
error-prone 2.50.0
null-away 0.14.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions