[jira] [Updated] (GROOVY-9171) Static compiler ASM error for methods with identical names

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (GROOVY-9171) Static compiler ASM error for methods with identical names

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/GROOVY-9171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lőrinc Pap updated GROOVY-9171:
-------------------------------
    Affects Version/s: 2.5.7

> Static compiler ASM error for methods with identical names
> ----------------------------------------------------------
>
>                 Key: GROOVY-9171
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9171
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.7
>            Reporter: Lőrinc Pap
>            Priority: Major
>
> After updating Gradle from Groovy {{2.5.4}} to {{2.5.7}} the following file fails to compile:
> [https://github.com/gradle/gradle/blob/979d243c0eb81008a84e42a24cb43afc166f2bce/buildSrc/subprojects/performance/src/main/groovy/org/gradle/testing/RebaselinePerformanceTests.groovy#L34]
>  
> The error is the following:
> {code:java}
> Method: MethodNode@1932705[org.gradle.testing.RebaselinePerformanceTests$_rebaseline_closure1#java.lang.Object doCall(java.lang.Object)]
> Line 34, expecting casting to java.lang.Object but operand stack is empty
> java.lang.ArrayIndexOutOfBoundsException: Internal compiler error while compiling /home/tcagent1/agent/work/668602365d1521fc/buildSrc/subprojects/performance/src/main/groovy/org/gradle/testing/RebaselinePerformanceTests.groovy
> Method: MethodNode@1932705[org.gradle.testing.RebaselinePerformanceTests$_rebaseline_closure1#java.lang.Object doCall(java.lang.Object)]
> Line 34, expecting casting to java.lang.Object but operand stack is empty
>    at org.codehaus.groovy.classgen.asm.OperandStack.throwExceptionForNoStackElement(OperandStack.java:331)
>    at org.codehaus.groovy.classgen.asm.OperandStack.doConvertAndCast(OperandStack.java:336)
>    at org.codehaus.groovy.classgen.asm.OperandStack.doGroovyCast(OperandStack.java:300)
>    at org.codehaus.groovy.classgen.asm.StatementWriter.writeReturn(StatementWriter.java:607)
>    at org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmClassGenerator.java:685)
>    at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:47)
>    at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:93)
>    at org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeBlockStatement(StaticTypesStatementWriter.java:81)
>    at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:635)
>    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
>    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:110)
>    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:121)
>    at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:495)
>    at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:431)
>    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:132)
>    at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:576)
>    at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1103)
>    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
>    at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:269)
>    at org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:854)
>    at org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:871)
>    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1084)
>    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:645)
>    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:623)
>    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:600)
>    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
>    at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
>    at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
>    at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:84)
>    at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:72)
>    at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:99)
>    at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:79)
>    at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:44)
>    at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:34)
>    at org.gradle.workers.internal.IsolatedClassloaderWorker.execute(IsolatedClassloaderWorker.java:55)
>    at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:55)
>    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>    at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:116)
>    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
>    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
>    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
>    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
>    at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)
>    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
>    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
>    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
>    at java.base/java.lang.Thread.run(Thread.java:834)
> {code}
>  
> The related PR is [https://github.com/gradle/gradle/pull/9627#discussion_r292402763]
>  
> Changing {{each}} to {{for}} loop reveals a different stack and a hint at an {{ASM}} related problem:
> {code:java}
> groovy.lang.GroovyRuntimeException: ASM reporting processing error for org.gradle.testing.RebaselinePerformanceTests#rebaseline with signature void rebaseline() in RebaselinePerformanceTests.groovy:31. /home/tcagent1/agent/work/668602365d1521fc/buildSrc/subprojects/performance/src/main/groovy/org/gradle/testing/RebaselinePerformanceTests.groovy
> at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:455)
> at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:132)
> at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:576)
> at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1103)
> at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
> at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:269)
> at org.codehaus.groovy.control.CompilationUnit$18.call(CompilationUnit.java:854)
> at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1084)
> at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:645)
> at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:623)
> at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:600)
> at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
> at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
> at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
> at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:84)
> at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:72)
> at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:99)
> at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:79)
> at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:44)
> at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:34)
> at org.gradle.workers.internal.IsolatedClassloaderWorker.execute(IsolatedClassloaderWorker.java:55)
> at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:55)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:116)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
> at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
> at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
> at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
> at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)
> at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
> at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
> at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
> at groovyjarjarasm.asm.Frame.merge(Frame.java:1268)
> at groovyjarjarasm.asm.Frame.merge(Frame.java:1233)
> at groovyjarjarasm.asm.MethodWriter.computeAllFrames(MethodWriter.java:1607)
> at groovyjarjarasm.asm.MethodWriter.visitMaxs(MethodWriter.java:1543)
> at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:436)
> ... 41 more
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)