[ 
https://issues.apache.org/jira/browse/GROOVY-9115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16837760#comment-16837760
 ] 

Daniel Sun commented on GROOVY-9115:
------------------------------------

The bytecode of method  {{m}} generated by 3.0.0-alpha-4

{code:java}
  // access flags 0x2
  private m()Ljava/lang/Object;
   L0
   L1
    LINENUMBER 15 L1
    ICONST_1
    IFEQ L2
   L3
    LINENUMBER 16 L3
    ALOAD 0
    CHECKCAST Derived
    INVOKEVIRTUAL Derived.f ()Ljava/io/File;
    ASTORE 1
   L4
    ALOAD 1
    POP
   L5
    LINENUMBER 17 L5
    ALOAD 0
    GETFIELD Derived.content : Ljava/lang/String;
    ASTORE 2
    ALOAD 2
    ACONST_NULL
    ALOAD 1
    LDC "text"
    CHECKCAST java/lang/String
    INVOKESTATIC org/codehaus/groovy/runtime/ScriptBytecodeAdapter.setProperty 
(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/String;)V
    ALOAD 2
    POP
   L6
   L7
    LINENUMBER 18 L7
   L8
   L2
   L9
    LINENUMBER 20 L9
    ACONST_NULL
    ARETURN
   L10
   L11
    LINENUMBER 21 L11
    LOCALVARIABLE this LDerived; L0 L10 0
    LOCALVARIABLE file Ljava/io/File; L4 L6 1
   L12
    ACONST_NULL
    ARETURN
    MAXSTACK = 0
    MAXLOCALS = 0
{code}


The bytecode of method  {{m}} generated by 3.0.0-beta-1

{code:java}
  // access flags 0x1
  public <init>()V
  @Lgroovy/transform/Generated;()
   L0
    ALOAD 0
    INVOKESPECIAL Base.<init> ()V
   L1
   L2
    LINENUMBER 22 L2
    LOCALVARIABLE this LDerived; L0 L1 0
   L3
    RETURN
    MAXSTACK = 0
    MAXLOCALS = 0

  // access flags 0x2
  private m()Ljava/lang/Object;
   L0
   L1
    LINENUMBER 15 L1
    ICONST_1
    IFEQ L2
   L3
    LINENUMBER 16 L3
    ALOAD 0
    CHECKCAST Derived
    INVOKEVIRTUAL Derived.f ()Ljava/io/File;
    ASTORE 1
   L4
    ALOAD 1
    POP
   L5
    LINENUMBER 17 L5
    ALOAD 0
    GETFIELD Derived.content : Ljava/lang/String;
    DUP
    ASTORE 2
    ALOAD 1
    INVOKESTATIC org/codehaus/groovy/runtime/ResourceGroovyMethods.getText 
(Ljava/io/File;)Ljava/lang/String;
    POP
   L6
   L7
    LINENUMBER 18 L7
   L8
   L2
   L9
    LINENUMBER 20 L9
    ACONST_NULL
    ARETURN
   L10
   L11
    LINENUMBER 21 L11
    LOCALVARIABLE this LDerived; L0 L10 0
    LOCALVARIABLE file Ljava/io/File; L4 L6 1
   L12
    ACONST_NULL
    ARETURN
    MAXSTACK = 0
    MAXLOCALS = 0

{code}


> General error during class generation
> -------------------------------------
>
>                 Key: GROOVY-9115
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9115
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.5.7
>            Reporter: paolo di tommaso
>            Priority: Major
>         Attachments: bytecode.diff.PNG
>
>
> Upgrading to Groovy 2.5.7 from 2.5.6 I'm getting the following compiler crash 
> {code}
> General error during class generation: ASM reporting processing error for 
> nextflow.k8s.client.K8sClient#podCreate with signature 
> nextflow.k8s.client.K8sResponseJson podCreate(java.util.Map, 
> java.nio.file.Path) in K8sClient.groovy:149. 
> /Users/pditommaso/Projects/nextflow/modules/nextflow/src/main/groovy/nextflow/k8s/client/K8sClient.groovy
> groovy.lang.GroovyRuntimeException: ASM reporting processing error for 
> nextflow.k8s.client.K8sClient#podCreate with signature 
> nextflow.k8s.client.K8sResponseJson podCreate(java.util.Map, 
> java.nio.file.Path) in K8sClient.groovy:149. 
> /Users/pditommaso/Projects/nextflow/modules/nextflow/src/main/groovy/nextflow/k8s/client/K8sClient.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:77)
>         at 
> org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:65)
>         at 
> org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:88)
>         at 
> org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:76)
>         at 
> org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
>         at 
> org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:46)
>         at 
> org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:30)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at 
> org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:101)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at 
> org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
>         at 
> org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
>         at 
> org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
>         at 
> org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
>         at 
> org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
>         at 
> org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
>         at 
> org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at 
> org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
>         at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 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)
> {code}
> Unfortunately, I was unable to isolate the issue. The code raising the error 
> is at [this 
> link|https://github.com/nextflow-io/nextflow/blob/b49e6d74dae782def6be2b087d06fdd8fa6b9291/modules/nextflow/src/main/groovy/nextflow/k8s/client/K8sClient.groovy#L149].
>  



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

Reply via email to