-
Notifications
You must be signed in to change notification settings - Fork 193
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
Groovy Eclipse throwing StackOverflowError: null at org.codehaus.groovy.control.GenericsVisitor.getPrintName #148
Comments
I'm hitting this also. From the debugger, it appears this is an issue handling generics when a type references a generic that references itself, i.e |
Looks like the problem is specific to the handling of |
A simple example to reproduce this is // A.java
public interface A<Q extends A<? super Q>> {
}
// B.groovy
class B {
public void test(A<?> a) {
}
} |
Hi @will-lauer , do you think this is an issue with Groovy itself then, rather than the Groovy-Eclipse plug in? |
It doesn't look like it. It looks like the lazy creation of the AST and associated objects that the groovy-eclipse plugin does to allow for recoverable parsing can create an object structure with a cycle in it when building the type information for the interface listed above. Then, when trying to traverse that graph when validating generics, it goes off into an infinite loop. I don't really understand the code well enough to identify the real fix, but I have a simple workaround that I'm testing, and once its ready I'll post it as a pull request. Basically, when trying to print the error message about an invalid use of generics, the error would print the type names directly rather than the fully qualified name will exploded generic information. That prevents it from traversing the object structure with a cycle in it. My fix also has a braindead fix for an additional bug that this uncovered. In the example above, an error will be generated basically saying that <?> doesn't match |
Possible fix for groovy#148. - Ensure wildcards don't cause generic resolution to fail - don't get caught in an infinite loop while printing generic type names
Possible fix for groovy#148. - Ensure wildcards don't cause generic resolution to fail - don't get caught in an infinite loop while printing generic type names
Possible fix for groovy#148. - Ensure wildcards don't cause generic resolution to fail - don't get caught in an infinite loop while printing generic type names
Hi, I just installed the Groovy Eclipse plugin from this link http://dist.springsource.org/snapshot/GRECLIPSE/e4.5/
onto Eclipse Mars SR1, and I get a StackOverFlowError: null as soon as I start Eclipse and it tries to build the workspace.
Here is the full error log:
STATUS
pluginId org.eclipse.core.jobs
pluginVersion 3.7.0.v20150330-2103
code 2
severity 4
message An internal error occurred during: "Building workspace".
fingerprint d38a9ecb
Exception:java.lang.StackOverflowError: null
at org.eclipse.jdt.internal.compiler.lookup.TypeSystem.getDerivedTypes(TypeSystem.java:422)
at org.eclipse.jdt.internal.compiler.lookup.AnnotatableTypeSystem.getRawType(AnnotatableTypeSystem.java:142)
at org.eclipse.jdt.internal.compiler.lookup.AnnotatableTypeSystem.getRawType(AnnotatableTypeSystem.java:167)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createRawType(LookupEnvironment.java:1018)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.convertToRawType(LookupEnvironment.java:553)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.toRawType(JDTClassNodeBuilder.java:133)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureParameterizedType(JDTClassNodeBuilder.java:344)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureType(JDTClassNodeBuilder.java:68)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureTypeVariableReference(JDTClassNodeBuilder.java:243)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureTypeVariableDefinition(JDTClassNodeBuilder.java:254)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureTypeVariables(JDTClassNodeBuilder.java:95)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.setupGenerics(JDTClassNode.java:179)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.ensureGenericsInitialized(JDTClassNode.java:434)
at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.getGenericsTypes(JDTClassNode.java:422)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:135)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:140)
at org.codehaus.groovy.control.GenericsVisitor.getPrintName(GenericsVisitor.java:123)
...
REPORT
anonymousId 7b821dca-121f-4f1d-a72d-06ac70fbcfa7
name
email
comment
eclipseBuildId 4.5.1.M20150904-0015
eclipseProduct org.eclipse.epp.package.jee.product
javaRuntimeVersion 1.8.0_45-internal-b14
osgiWs gtk
osgiOs Linux
osgiOsVersion 3.19.0
osgiArch x86_64
logMessage false
ignoreSimilar false
BUNDLES
name org.codehaus.groovy
version 2.3.10.xx-201508121448-e45
name org.eclipse.jdt
version 3.11.1.v20150904-0015
The text was updated successfully, but these errors were encountered: