ArrayIndexOutOfBoundsException while Instrumentation
Brought to you by:
vlad_r
Hi Vlad,
EclEmma users report ArrayIndexOutOfBoundsExceptions while instrumenting Code, which has been generated with the Eclipse compiler against Java 1.6. A got at least two different Stack traces (see below), unfortunately I don't have a reproducable test case yet.
EMMA version is 2.0.5312 (with a minor fix in Logger, see bug #1641403).
The corresponding EclEmma bug is:
https://sourceforge.net/tracker/?func=detail&atid=883351&aid=1912359&group_id=177969
Best regards,
-marc
Logged In: YES
user_id=1586594
Originator: YES
TRACE 1:
com.vladium.emma.EMMARuntimeException: [UNEXPECTED_FAILURE] unexpected
failure java.lang.ArrayIndexOutOfBoundsException: 3, please submit a bug
report to: 'http://www.eclemma.org/support.html'
at
com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:784)
at com.vladium.emma.Processor.run(Processor.java:54)
at
com.mountainminds.eclemma.internal.core.instr.ClassFiles.instrument(ClassFiles.java:119)
at
com.mountainminds.eclemma.internal.core.launching.CoverageLaunchInfo.instrument(CoverageLaunchInfo.java:100)
at
com.mountainminds.eclemma.core.launching.CoverageLauncher.launch(CoverageLauncher.java:182)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:766)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:868)
at
com.vladium.jcd.cls.attribute.CodeAttribute_info.accept(CodeAttribute_info.java:137)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:446)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:255)
at com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:111)
at
com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:471)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:193)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumerate(IPathEnumerator.java:97)
at
com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:715)
... 9 more
Logged In: YES
user_id=1586594
Originator: YES
TRACE 2:
com.vladium.emma.EMMARuntimeException: [UNEXPECTED_FAILURE] unexpected
failure java.lang.ArrayIndexOutOfBoundsException: 622, please submit a bug
report to: 'http://www.eclemma.org/support.html'
at
com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:784)
at com.vladium.emma.Processor.run(Processor.java:54)
at
com.mountainminds.eclemma.internal.core.instr.ClassFiles.instrument(ClassFiles.java:119)
at
com.mountainminds.eclemma.internal.core.launching.CoverageLaunchInfo.instrument(CoverageLaunchInfo.java:100)
at
com.mountainminds.eclemma.core.launching.CoverageLauncher.launch(CoverageLauncher.java:182)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:764)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:614)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:827)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1030)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 622
at
com.vladium.emma.instr.InstrVisitor$Block.emit(InstrVisitor.java:1445)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:1144)
at
com.vladium.jcd.cls.attribute.CodeAttribute_info.accept(CodeAttribute_info.java:137)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:446)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:255)
at com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:111)
at
com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:471)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:193)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumerate(IPathEnumerator.java:97)
at
com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:715)
... 9 more
Logged In: YES
user_id=1686698
Originator: NO
I encountered this issue today after updating to the latest Ubuntu release (Heron). Ubuntu appears to have updated my jdk to 1.6.0.06. I downloaded & installed update 2 instead and the error in Emma went away. This is with emma-2.0.5312.jar.
Logged In: YES
user_id=1686698
Originator: NO
Sorry. I forgot to mention that I'm running the 64-bit (server) JVM:
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_02-b05, mixed mode)
Logged In: YES
user_id=849391
Originator: NO
face the problem myself, on a application compiled with jdk1.6.0_06, when switching the compilation to use JAVA_HOME=/usr/jdk/1.5.0_09 it all worked fine.
Compiling or not from Eclipse doesn't seems to affect the behaviour.
Though i'm not familiar with Eclipse, may be there are some compilation settings that could enter in account.
i use to have stacktrace :
[copy] Copying 1 file to /tmp/coverage-instr/lib
[move] Moving 1 file to /tmp/build/package
[java] EMMA: processing instrumentation path ...
[java] [EMMA v2.0, build 5312]
[java] emma instr: [UNEXPECTED_FAILURE] unexpected failure java.lang.ArrayIndexOutOfBoundsException: 34, please submit a bug report to: 'http://sourceforge.net/projects/emma'
[java] Exception in thread "main" com.vladium.emma.EMMARuntimeException: [UNEXPECTED_FAILURE] unexpected failure java.lang.ArrayIndexOutOfBoundsException: 34, please submit a bug report to: 'http://sourceforge.net/projects/emma'
[java] at com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:784)
[java] at com.vladium.emma.Processor.run(Processor.java:54)
[java] at com.vladium.emma.instr.instrCommand.run(instrCommand.java:163)
[java] at emma.main(emma.java:40)
[java] Caused by: java.lang.ArrayIndexOutOfBoundsException: 34
[java] at com.vladium.emma.instr.InstrVisitor$Block.emit(InstrVisitor.java:1445)
[java] at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:1144)
[java] at com.vladium.jcd.cls.attribute.CodeAttribute_info.accept(CodeAttribute_info.java:137)
[java] at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:446)
[java] at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:255)
[java] at com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:111)
[java] at com.vladium.emma.instr.InstrProcessorST.handleArchiveEntry(InstrProcessorST.java:223)
[java] at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathArchive(IPathEnumerator.java:235)
[java] at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumerate(IPathEnumerator.java:113)
[java] at com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:715)
[java] ... 3 more
[java] Java Result: 1
Logged In: YES
user_id=917695
Originator: NO
Also got this with 1.6.0_05 on a mac:
Trying the swing set example:
dminnigerode:emma dminnigerode$ java -cp emma-2.0.5312.jar emma instr -m
overwrite -ip SwingSet2.jar
EMMA: processing instrumentation path ...
[EMMA v2.0, build 5312]
emma instr: [UNEXPECTED_FAILURE] unexpected failure
java.lang.ArrayIndexOutOfBoundsException: 14, please submit a bug report
to: 'http://sourceforge.net/projects/emma'
Exception in thread "main" com.vladium.emma.EMMARuntimeException:
[UNEXPECTED_FAILURE] unexpected failure
java.lang.ArrayIndexOutOfBoundsException: 14, please submit a bug report
to: 'http://sourceforge.net/projects/emma'
at
com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:784)
at com.vladium.emma.Processor.run(Processor.java:54)
at com.vladium.emma.instr.instrCommand.run(instrCommand.java:163)
at emma.main(emma.java:40)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 14
at com.vladium.emma.instr.InstrVisitor$Block.emit(InstrVisitor.java:1445)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:1144)
at
com.vladium.jcd.cls.attribute.CodeAttribute_info.accept(CodeAttribute_info.
java:137)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:446)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:255)
at com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:111)
at
com.vladium.emma.instr.InstrProcessorST.handleArchiveEntry(InstrProcessorST
.java:223)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathArchiv
e(IPathEnumerator.java:235)
at
com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumerate(IPathEnum
erator.java:113)
at
com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:715)
... 3 more
Platform/JVM info:
dminnigerode:emma dminnigerode$ uname -v
Darwin Kernel Version 9.3.0: Fri May 23 00:49:16 PDT 2008;
root:xnu-1228.5.18~1/RELEASE_I386
dminnigerode:emma dminnigerode$ java -fullversion
java full version "1.6.0_05-b13-120"
That's OS X 10.5.3
Logged In: YES
user_id=2141942
Originator: NO
Hi,
we just moved from:
jdk1.5.0_06
to:
jdk1.6.0_07
and have experienced this same problem
Logged In: YES
user_id=2130791
Originator: NO
Is this the same? On Fedora 9, OpenJDK 1.6.0, I get a stacktrace (attached). I'm rather new to emma, and anything is possible. I started with a small project, and emma worked fine. Now, after adding a few more source files, I get the exceptions. I guess the heart is
Caused by: java.lang.ArrayIndexOutOfBoundsException: 20
at com.vladium.emma.instr.InstrVisitor$Block.emit(InstrVisitor.java:1445)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:1144)
at com.vladium.jcd.cls.attribute.CodeAttribute_info.accept(CodeAttribute_info.java:137)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:446)
Attaching complete dump
Logged In: YES
user_id=2130791
Originator: NO
No, I dont attach the complete dump, I can't... Guess it doesn't matter..
Logged In: YES
user_id=794205
Originator: NO
I also get this exact same bug on 64 bit Centos ES5.2 running under Xen virtual machine
# java -version
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b19, mixed mode)
# uname -a
Linux vmRoberts.sydney.imprezzeo.priv 2.6.18-92.1.6.el5xen #1 SMP Wed Jun 25 14:13:10 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
The build works well on my desktop running Mandriva 2008 and :
# java -version
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)
# uname -a
Linux kelpie5 2.6.24.5-laptop-2mnb #1 SMP Thu Jun 12 14:47:38 EDT 2008 i686 Genuine Intel(R) CPU T2400 @ 1.83GHz GNU/Linux
Logged In: YES
user_id=794205
Originator: NO
FIXED - Upgrading to SUN JDK - Java SE 6 Update 10 overcame this problem.
Logged In: YES
user_id=1471819
Originator: NO
I'm copy and pasting my own experience with EclEMMA, as reported in EclEMMA bug #1912359:
My own experience:
- Eclipse 3.4 64 bit version under Windows XP x64, runned with JRE
1.6.0_05 64-bit, code compiled with 1.5 conformance and runned with a
1.5.0_15 64-bit JRE: this problem does occur
- Eclipse 3.4 64 bit version under Windows XP x64, runned with JRE
1.6.0_05 64-bit, code compiled with 1.5 conformance and runned with a
1.6.0_05 64-bit JRE: this problem does occur
- Eclipse 3.4 64 bit version under Windows XP x64, runned with JRE
1.5.0_15 64-bit, code compiled with 1.5 conformance and runned with a
1.5.0_15 64-bit JRE: this problem does not occur
- Eclipse 3.4 32 bit version under Linux Ubuntu, runned with JRE 1.6.0_06
32-bit, code compiled with 1.5 conformance and runned with a 1.5.0_16
32-bit JRE: this problem does not occur
Please note that when using the 1.6.0_05 JRE for running Eclipse, the
following VM parameters are used, buth under WinXPx64 and Linux:
-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
-XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,<init>
because of the HotSpot 10 bug referenced by:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214092
My suspect, anyway, is that the problem resides in running Eclipse with a
1.6.0 64-bit JRE.
Mauro.
Logged In: YES
user_id=639492
Originator: NO
I can confirm this on 1.6.0_06, 1.6.0_07 and the 1.6.0_10 release candidate.
Sometimes (10% of the time? Can't find a way to reproduce) it seems to work, the rest of the time it fails like this.
Given that the last update to this project was over three years ago, I think the odds of it being fixed without one of us giving it a shot are pretty slim.
This is caused by a synchronization issue in the InstrVisitor. I have a fix and will attach the patch to this issue. If anyone is still mantaining this it would be good to add that.
Hi Chris,
yes, please provide the patch. For EclEmma I maintain a version of EMMA with few important patches.
And could you please explain some details about the issue? From my understanding the instrumentation process is a single threaded only.
Best regards,
-marc
Hi Marc,
I think Skizz's patch is at http://sourceforge.net/tracker/index.php?func=detail&aid=2119913&group_id=108932&atid=651897
(bug number 2119913).
Mauro.
I got the same problem running on macOS.
I'm using EMMA 2.1.5320
com.vladium.emma.EMMARuntimeException: [UNEXPECTED_FAILURE] unexpected failure java.lang.ArrayIndexOutOfBoundsException: 14, please submit a bug report to: 'http://sourceforge.net/projects/emma'
at com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:784)
at com.vladium.emma.Processor.run(Processor.java:88)
at org.sonatype.maven.plugin.emma.EmmaInstrumentMojo.doExecute(EmmaInstrumentMojo.java:147)
at org.sonatype.maven.plugin.emma.AbstractEmmaMojo.execute(AbstractEmmaMojo.java:147)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:458)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:676)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:538)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:517)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:369)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:302)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 14
at com.vladium.emma.instr.InstrVisitor$Block.emit(InstrVisitor.java:1484)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:1163)
at com.vladium.jcd.cls.attribute.CodeAttribute_info.accept(CodeAttribute_info.java:137)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:465)
at com.vladium.emma.instr.InstrVisitor.visit(InstrVisitor.java:274)
at com.vladium.emma.instr.InstrVisitor.process(InstrVisitor.java:118)
at com.vladium.emma.instr.InstrProcessorST.handleFile(InstrProcessorST.java:471)
at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:193)
at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumeratePathDir(IPathEnumerator.java:177)
at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumerate(IPathEnumerator.java:97)
at com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:715)
... 21 more