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

StackOverflow in BindingsResolver #735

Closed
josvanroosmalen opened this issue Dec 9, 2014 · 4 comments
Closed

StackOverflow in BindingsResolver #735

josvanroosmalen opened this issue Dec 9, 2014 · 4 comments
Labels

Comments

@josvanroosmalen
Copy link

What is the workarround, fix for the following?

Bug tested with:

Eclipse 4.4.1 (RCP/RAP)
Rascal 0.7.1.201412021009

I have a endless-recursion stackoverflow crash -> I got it crashing on both Win 32bit and Linux 64-bit, and different runtimes.

This:

loc c = |java+constructor:///org/hsqldb/StatementInsert/StatementInsert(org.hsqldb.Session,org.hsqldb.Table,int%5B%5D,org.hsqldb.Expression,boolean%5B%5D,org.hsqldb.ParserDQL.CompileContext)|;
M3 m3 = createM3FromEclipseProject(|project://hsqldb/|);  
Declaration d = getMethodASTEclipse(c);

Will cause the exception below.

Reproduction:

import bug;
bug();

After a few minutes it will crash with:

rascal>bug();
|bundleresource://502.fwk19180746:2/src/org/rascalmpl/library/lang/java/m3/AST.rsc|(7479,375,<200,0>,<207,99>): Java("StackOverflowError","")
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.resolveBinding(|file:///BindingsResolver.java|(0,0,<475,0>,<475,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.resolveBinding(|file:///BindingsResolver.java|(0,0,<220,0>,<220,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.resolveType(|file:///BindingsResolver.java|(0,0,<234,0>,<234,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.computeTypes(|file:///BindingsResolver.java|(0,0,<262,0>,<262,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.boundSymbol(|file:///BindingsResolver.java|(0,0,<373,0>,<373,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.computeTypeSymbol(|file:///BindingsResolver.java|(0,0,<351,0>,<351,0>))
    at 

... snipping LONG stack trace ..

    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.resolveType(|file:///BindingsResolver.java|(0,0,<236,0>,<236,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.computeTypes(|file:///BindingsResolver.java|(0,0,<262,0>,<262,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.computeTypeSymbol(|file:///BindingsResolver.java|(0,0,<341,0>,<341,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.resolveType(|file:///BindingsResolver.java|(0,0,<236,0>,<236,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.computeTypes(|file:///BindingsResolver.java|(0,0,<262,0>,<262,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.boundSymbol(|file:///BindingsResolver.java|(0,0,<373,0>,<373,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.computeTypeSymbol(|file:///BindingsResolver.java|(0,0,<351,0>,<351,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.resolveType(|file:///BindingsResolver.java|(0,0,<236,0>,<236,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.computeTypes(|file:///BindingsResolver.java|(0,0,<262,0>,<262,0>))
    at org.rascalmpl.library.lang.java.m3.internal.BindingsResolver.computeTypeSymbol(|file:///BindingsResolver.java|(0,0,<341,0>,<341,0>))
    at createAstFromFile(|bundleresource://503.fwk19180746/src/org/rascalmpl/eclipse/library/lang/java/jdt/m3/AST.rsc|(1032,10,<27,63>,<27,73>))
    at getMethodASTEclipse(|bundleresource://503.fwk19180746/src/org/rascalmpl/eclipse/library/lang/java/jdt/m3/Core.rsc|(1335,110,<43,27>,<43,137>))
    at bug(|stdin:///|(0,3,<1,0>,<1,3>))
    at $shell$(|stdin:///|(0,6,<1,0>,<1,6>))
@ashimshahi
Copy link
Contributor

Hi Jos. This is a known issue we are having after updates to Eclipse JDT. We are looking into resolving it as soon as possible.

For now the workaround would be to use Eclipse Kepler (4.3.2 without Java8 patches). I would also recommend against updating any plugin that come pre bundled.

@josvanroosmalen
Copy link
Author

Thanks then please link this issue to the leading issue and close this one.

@josvanroosmalen
Copy link
Author

This suggested workaround does work. Thanks.

@jurgenvinju
Copy link
Member

Small code example to trigger the bug:

public class ValidatingResourceBundle {
    public void validate() {
        protected Class<? extends Enum<?>> enumType;
        enumType.getEnumConstants()
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants