Marc, how you execute CheckClassAdapter ? My attempt shows a lot of "ClassNotFoundException" because of missing classes that this class depends on, but no "Execution can fall off end of the code". Also looking at "<clinit>" in output of "javap -v -p UiApiPlugin.class", I don't see how it can fall off end of the code.
Even if class is potentially is invalid, I have strong feeling of something fishy here - an attempt to add frame into class that originally has no frames. Seems that for instructions of method "a(Lcom/tencent/biz/webviewplugin/PubAccountUIPlugin;)Ljava/lang/String" , I'm currently investigating and will keep you posted. On Wednesday, March 28, 2018 at 6:34:47 PM UTC+2, Marc R. Hoffmann wrote: > > Hi, > > looks like dex2jar is creating invalid class files. I did a quick sanity > check with ASMs CheckClassAdapter and get the following result: > > Exception in thread "main" java.lang.RuntimeException: *Execution can > fall off end of the code <clinit>()V* > at > org.objectweb.asm.util.CheckMethodAdapter$1.visitEnd(CheckMethodAdapter.java:467) > at org.objectweb.asm.MethodVisitor.visitEnd(MethodVisitor.java:878) > at > org.objectweb.asm.util.CheckMethodAdapter.visitEnd(CheckMethodAdapter.java:1038) > at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1130) > at org.objectweb.asm.ClassReader.accept(ClassReader.java:698) > at org.objectweb.asm.ClassReader.accept(ClassReader.java:500) > > As mentioned before: JaCoCo requires valid class files as an input. > > Regards, > -marc > > On 2018-03-28 13:14, Tool Ply wrote: > > There is another .class file that failed jacoco 0.8.0. The interesting is > that the major version is 49 which means Java 1.5 bytecode. So I tried > following things. > > 1. Is this a legal .class? > being unfamiliar with .class. I can just decompile UiApiPlugin.class > by javap. Though verbose information I got, I am still not sure whether it > is legal class. > > 2. Does Jacoco support Java 1.5 bytecode? > It is correct. JaCoCo requires java 1.5 > <https://www.jacoco.org/jacoco/trunk/doc/implementation.html> > > So, how to confirm whether the class is legal > > 在 2018年3月23日星期五 UTC+8上午1:21:33,Evgeny Mandrikov写道: >> >> $ javap -v -p aaqc.class | grep "major version" >> major version: 50 >> >> i.e. contains Java 1.6 bytecode. >> >> http://www.jacoco.org/jacoco/trunk/doc/faq.html clearly states : class >> files version 1.6 and above have to contain valid stackmap frames >> >> $ javap -v -p aaqc.class | grep StackMapTable | wc -l >> 0 >> >> i.e. there is no stackmap frames in aaqc.class >> >> If other tools create invalid class files JaCoCo cannot be used on those >> files. >> >> >> On Thursday, March 22, 2018 at 3:00:32 AM UTC+1, Tool Ply wrote: >>> >>> >>> >>> 在 2018年3月22日星期四 UTC+8上午1:56:59,Evgeny Mandrikov写道: >>>> >>>> Please provide "abap.class". >>>> >>>> On Wednesday, March 21, 2018 at 6:03:53 PM UTC+1, Tool Ply wrote: >>>>> >>>>> I tried to instrument a jar which was translated from an apk by using >>>>> dex2jar. Then the error arised. >>>>> >>>>> There are some details about command and exception. >>>>> >>>>> *java -jar >>>>> /home/ren/MyProject/tcg-android/jacoco-android/org.jacoco.cli/target/org.jacoco.cli-0.8.1-SNAPSHOT-nodeps.jar >>>>> >>>>> instrument mobileqq_android-dex2jar.jar —dest operation_pool/* >>>>> >>>>> Exception in thread "main" java.io.IOException: Error while >>>>> instrumenting >>>>> /home/ren/.local/share/Trash/files/jacoco-android/instrument/[email protected]. >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrumentError(Instrumenter.java:174) >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrument(Instrumenter.java:123) >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrument(Instrumenter.java:148) >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrument(Instrumenter.java:168) >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrumentAll(Instrumenter.java:207) >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrumentZip(Instrumenter.java:235) >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrumentAll(Instrumenter.java:210) >>>>> at >>>>> org.jacoco.cli.internal.commands.Instrument.instrument(Instrument.java:88) >>>>> at >>>>> org.jacoco.cli.internal.commands.Instrument.execute(Instrument.java:58) >>>>> at org.jacoco.cli.internal.Main.execute(Main.java:89) >>>>> at org.jacoco.cli.internal.Main.main(Main.java:104) >>>>> *Caused by: java.lang.ArrayIndexOutOfBoundsException: -1* >>>>> at org.jacoco.cli.internal.asm.Frame.merge(Frame.java:1415) >>>>> at >>>>> org.jacoco.cli.internal.asm.CurrentFrame.execute(CurrentFrame.java:52) >>>>> at >>>>> org.jacoco.cli.internal.asm.MethodWriter.visitVarInsn(MethodWriter.java:781) >>>>> at >>>>> org.jacoco.cli.internal.asm.ClassReader.readCode(ClassReader.java:1472) >>>>> at >>>>> org.jacoco.cli.internal.asm.ClassReader.readMethod(ClassReader.java:1126) >>>>> at >>>>> org.jacoco.cli.internal.asm.ClassReader.accept(ClassReader.java:698) >>>>> at >>>>> org.jacoco.cli.internal.asm.ClassReader.accept(ClassReader.java:500) >>>>> at >>>>> org.jacoco.cli.internal.asm.ClassWriter.toByteArray(ClassWriter.java:1042) >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrument(Instrumenter.java:102) >>>>> at >>>>> org.jacoco.cli.internal.core.instr.Instrumenter.instrument(Instrumenter.java:121) >>>>> ... 9 more >>>>> >>>>> >>>>> ps: >>>>> both the newest code from github and release version 0.8.0 arise >>>>> this exception. >>>>> >>>>> >>>> > -- > You received this message because you are subscribed to the Google Groups > "JaCoCo and EclEmma Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jacoco/548cedbb-7def-42b1-a355-f27f8d87a522%40googlegroups.com > > <https://groups.google.com/d/msgid/jacoco/548cedbb-7def-42b1-a355-f27f8d87a522%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/21b73862-10db-4c82-a5f5-47483694a3be%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
