Hi, I assume that provided class file is after instrumentation by another agent, but before instrumentation by JaCoCo. Is it correct?
If this is the case, then maybe first agent made a damage. This is the most common cause of such errors and as of today we are not aware of examples where JaCoCo produces invalid class files from valid inputs. And if class file was damaged, then strange to expect that JaCoCo can recover it. Because of this and to avoid other problems - our general recommendation: JaCoCo agent should be applied first, i.e. should be listed in command-line prior to other agents. Could you please try this and report the result back? Also provided class file has dependencies on other classes, and as far as I know there is no easy way to verify correctness of its bytecode or its instrumented version in absence of class files of its dependencies. However JaCoCo agent has parameter "classdumpdir" (see http://www.jacoco.org/jacoco/trunk/doc/agent.html) that allows to dump all classes prior to instrumentation. So will be beneficial if you will use this parameter and provide us all dumped classes, in order to be able to verify correctness of initial class and correctness of JaCoCo instrumentation. Or even better if you can somehow provide small, complete and isolated example demonstrating the same problem. In any case please also specify exact version of Java VM that you use. As a last resort there are agent parameters "includes" and "excludes" that can be used to exclude problematic class from JaCoCo instrumentation. Regards, Evgeny On Sunday, July 23, 2017 at 6:30:10 PM UTC+2, xiaoxi zheng wrote: > > Hi, > I got VerifyError below when running application with JaCoCo(tried both on > 0.7.2 and 0.7.9) instrumented class BaseEntityManager (attached). > Please note the class has already been instrumented by other bytecode > tool, but it is good without -javaagent:jacocoagent.jar. The full error is > also attached. > > ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > java.lang.VerifyError: Stack map does not match the one at exception > handler 917 > Exception Details: > Location: > > weblogic/ejb/container/manager/BaseEntityManager.executeUpdateStmt(Ljava/util/List;Ljavax/transaction/Transaction;Ljava/util/Set;ZZLjava/util/Collection;)V > > @917: astore > Reason: > Type 'java/lang/Object' (current frame, locals[20]) is not assignable > to null (stack map, locals[20]) > Current Frame: > bci: @893 > flags: { } > locals: { 'weblogic/ejb/container/manager/BaseEntityManager', > 'java/util/List', 'javax/transaction/Transaction', 'java/util/Set', > integer, integer, 'java/util/Collection', '[Z', integer, > 'java/sql/Connection', null, 'java/util/Map', > 'weblogic/ejb/container/persistence/spi/CMPBean', integer, integer, '[Z', > integer, null, integer, integer, 'java/lang/Object', top, top, top, top, > top, top, top, top, top, top, top, top, > 'weblogic/diagnostics/instrumentation/LocalHolder' } > stack: { 'java/sql/SQLException' } > Stackmap Frame: > bci: @917 > flags: { } > locals: { 'weblogic/ejb/container/manager/BaseEntityManager', > 'java/util/List', 'javax/transaction/Transaction', 'java/util/Set', > integer, integer, 'java/util/Collection', '[Z', integer, > 'java/sql/Connection', null, 'java/util/Map', > 'weblogic/ejb/container/persistence/spi/CMPBean', integer, integer, '[Z', > integer, null, integer, integer, null, top, top, top, top, top, top, top, > top, top, top, top, top, 'weblogic/diagnostics/instrumentation/LocalHolder' > } > stack: { 'java/sql/SQLException' } > -- 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/173d3d50-70e6-4394-b306-eb24631b3a47%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
