Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5398

Call to super is inconsistent, causes stack overflow.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.7.10, 1.8.6
    • Fix Version/s: None
    • Component/s: bytecode, Compiler
    • Labels:
      None
    • Environment:

      Description

      Nearly identical methods with calls to super.methodName(). One works and the other fails with a stack overflow. This has been tested with 1.8.6 and 1.7.10, fresh downloads, no CLASSPATH set or GROOVY_HOME that would invalidate the results.

      Output:

      andrew.smith@lt-asmith-mac ~/Downloads/groovy-1.7.10 % bin/groovy -version ; bin/groovy ~/Workspace/Testing/src/test/groovy/StackOverflowIssue.groovy | head -n 50
      Groovy Version: 1.7.10 JVM: 1.6.0_29
      Hello Andrew
      JUnit 4 Runner, Tests: 2, Failures: 1, Time: 237
      Test Failure: testAlternateCall(TestCase)
      java.lang.StackOverflowError
      	at java.lang.String.indexOf(String.java:1521)
      	at java.lang.ClassLoader.checkName(ClassLoader.java:775)
      	at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:947)
      	at groovy.lang.GroovyClassLoader$InnerLoader.loadClass(GroovyClassLoader.java:447)
      	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:793)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:127)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:147)
      	at C.createForACount(StackOverflowIssue.groovy:58)
      	at B.createForACount(StackOverflowIssue.groovy)
      	at C.super$4$createForACount(StackOverflowIssue.groovy)
      	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:127)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:147)
      	at C.createForACount(StackOverflowIssue.groovy:58)
      	at B.createForACount(StackOverflowIssue.groovy)
      	at C.super$4$createForACount(StackOverflowIssue.groovy)
      	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:127)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:147)
      	at C.createForACount(StackOverflowIssue.groovy:58)
      	at B.createForACount(StackOverflowIssue.groovy)
      	at C.super$4$createForACount(StackOverflowIssue.groovy)
      	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
      	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:127)
      

        Attachments

        1. StackOverflowIssue.groovy
          0.8 kB
          Andrew Smith

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              andrewrs Andrew Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: