Jacoco threw IOException exception while instrumenting the class

1,765 views
Skip to first unread message

matthew

unread,
Nov 25, 2014, 5:27:01 AM11/25/14
to jac...@googlegroups.com
Jacoco threw below exception while instrumenting the class, but others are okay.

[11/25/14 10:13:47:370 CST] 00000117 SystemErr R java.lang.instrument.IllegalClassFormatException: Error while instrumenting class com/xxx/xx/xx/xx/xxx
[11/25/14 10:13:47:370 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.CoverageTransformer.transform(CoverageTransformer.java:89)
[11/25/14 10:13:47:370 CST] 00000117 SystemErr R at sun.instrument.TransformerManager.transform(TransformerManager.java:200)
[11/25/14 10:13:47:370 CST] 00000117 SystemErr R at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:446)
[11/25/14 10:13:47:370 CST] 00000117 SystemErr R at java.lang.ClassLoader.defineClassImpl(Native Method)
[11/25/14 10:13:47:370 CST] 00000117 SystemErr R at java.lang.ClassLoader.defineClass(ClassLoader.java:306)
[11/25/14 10:13:47:370 CST] 00000117 SystemErr R at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
[11/25/14 10:13:47:370 CST] 00000117 SystemErr R at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:853)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:763)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:586)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at java.lang.ClassLoader.loadClass(ClassLoader.java:707)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at java.lang.J9VMInternals.verifyImpl(Native Method)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at java.lang.J9VMInternals.verify(J9VMInternals.java:94)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at java.lang.J9VMInternals.verify(J9VMInternals.java:92)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at java.lang.J9VMInternals.initialize(J9VMInternals.java:171)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at java.lang.Class.forNameImpl(Native Method)
[11/25/14 10:13:47:371 CST] 00000117 SystemErr R at java.lang.Class.forName(Class.java:181)
[....]
[11/25/14 10:13:47:372 CST] 00000117 SystemErr R at java.security.AccessController.doPrivileged(AccessController.java:274)
[....]
[11/25/14 10:13:47:373 CST] 00000117 SystemErr R Caused by: java.io.IOException: Error while instrumenting class com/xxx/xx/xx/xx/xxx
[11/25/14 10:13:47:373 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.core.instr.Instrumenter.instrumentError(Instrumenter.java:152)
[11/25/14 10:13:47:373 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.core.instr.Instrumenter.instrument(Instrumenter.java:103)
[11/25/14 10:13:47:373 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.CoverageTransformer.transform(CoverageTransformer.java:87)
[11/25/14 10:13:47:373 CST] 00000117 SystemErr R ... 35 more
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R Caused by: java.lang.ArrayIndexOutOfBoundsException
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at java.util.ArrayList.elementData(ArrayList.java:411)
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at java.util.ArrayList.remove(ArrayList.java:488)
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.commons.AnalyzerAdapter.pop(AnalyzerAdapter.java:552)
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.commons.AnalyzerAdapter.execute(AnalyzerAdapter.java:671)
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.commons.AnalyzerAdapter.visitVarInsn(AnalyzerAdapter.java:278)
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.tree.VarInsnNode.accept(VarInsnNode.java:86)
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.tree.InsnList.accept(InsnList.java:162)
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.tree.MethodNode.accept(MethodNode.java:815)
[11/25/14 10:13:47:374 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.core.internal.flow.ClassProbesAdapter$1.visitEnd(ClassProbesAdapter.java:122)
[11/25/14 10:13:47:375 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.ClassReader.readMethod(ClassReader.java:1021)
[11/25/14 10:13:47:375 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.ClassReader.accept(ClassReader.java:693)
[11/25/14 10:13:47:375 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.asm.ClassReader.accept(ClassReader.java:506)
[11/25/14 10:13:47:375 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.core.instr.Instrumenter.instrument(Instrumenter.java:83)
[11/25/14 10:13:47:375 CST] 00000117 SystemErr R at org.jacoco.agent.rt.internal_e6e56f0.core.instr.Instrumenter.instrument(Instrumenter.java:101)
[11/25/14 10:13:47:375 CST] 00000117 SystemErr R ... 36 more

Marc Hoffmann

unread,
Nov 25, 2014, 7:58:29 AM11/25/14
to jac...@googlegroups.com
Hi Matthew,

this typically happens when a class has invalid stackmap frames. Even if
the JVM has a fall-back to the old verififier in such situations, JaCoCo
accepts valid class files only. This is typically caused by other tools
or libraries modifying the Java bytecode (e.g. some persistence
implementations).

I could take a closer look, if you provide the class file
"com/xxx/xx/xx/xx/xxx" as seen by the JaCoCo agent. For this please
specify the 'classdumpdir' option to the JaCoCo agent (see
http://www.eclemma.org/jacoco/trunk/doc/agent.html).

Alternatively you might simply exclude the class in question.

Best regards,
-marc

matthew

unread,
Nov 25, 2014, 10:56:05 PM11/25/14
to jac...@googlegroups.com
Hi marc,

Excluding the class files as a workaround. Firstly I need check the class dump if there is security problem. if it is safety, i will provide it to you for finding root cause. Anyway, thanks for your reply.

BR/Matthew
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages