SourceForge has been redesigned. Learn more.
Close

#138 Conflict with other Java agents

Version 2.1.4
open
nobody
JaCoCo (32)
5
2015-01-05
2012-08-21
Anonymous
No

Using JaCoCo 0.5.10 and JMockit 0.999.16, a deadlock occurs when the JaCoCo CoverageTransformer receives a class being redefined by JMockit.

The following (partial) thread dump shows what happens at runtime, just after the deadlock:

"Attach Listener" daemon prio=10 tid=0x0076cc00 nid=0x618 in Object.wait() [0x00eee000]
java.lang.Thread.State: RUNNABLE
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:949)
at java.lang.reflect.Field.getFieldAccessor(Field.java:930)
at java.lang.reflect.Field.set(Field.java:680)
at org.jacoco.agent.rt_cdwjjf.core.runtime.AbstractRuntime.disconnect(AbstractRuntime.java:90)
at org.jacoco.agent.rt_cdwjjf.CoverageTransformer.transform(CoverageTransformer.java:90)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:170)
at mockit.internal.startup.Startup.redefineMethods(Startup.java:124)
at mockit.internal.startup.Startup.redefineMethods(Startup.java:118)
at mockit.internal.annotations.MockClassSetup.applyClassModifications(MockClassSetup.java:162)
at mockit.internal.annotations.MockClassSetup.redefineMethodsInClassHierarchy(MockClassSetup.java:128)
at mockit.internal.annotations.MockClassSetup.redefineMethods(MockClassSetup.java:117)
at mockit.internal.annotations.MockClassSetup.setUpStartupMock(MockClassSetup.java:111)
at mockit.internal.startup.JMockitInitialization.setUpInternalStartupMock(JMockitInitialization.java:56)
at mockit.internal.startup.JMockitInitialization.loadInternalStartupMocksForJUnitIntegration(JMockitInitialization.java:48)
at mockit.internal.startup.JMockitInitialization.initialize(JMockitInitialization.java:26)
at mockit.internal.startup.Startup.initialize(Startup.java:68)
at mockit.internal.startup.Startup.agentmain(Startup.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:407)

"main" prio=6 tid=0x0034c000 nid=0x10d0 runnable [0x0069e000]
java.lang.Thread.State: RUNNABLE
at sun.tools.attach.WindowsVirtualMachine.connectPipe(Native Method)
at sun.tools.attach.WindowsVirtualMachine.execute(WindowsVirtualMachine.java:100)
at sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:58)
at sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:79)
at sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:103)
at mockit.internal.startup.JDK6AgentLoader.loadAgentAndDetachFromThisVM(JDK6AgentLoader.java:117)
at mockit.internal.startup.JDK6AgentLoader.loadAgent(JDK6AgentLoader.java:61)
at mockit.internal.startup.AgentInitialization.initializeAccordingToJDKVersion(AgentInitialization.java:21)
at mockit.internal.startup.Startup.initializeIfNeeded(Startup.java:98)
at mockit.internal.startup.Startup.initializeIfPossible(Startup.java:112)
at org.junit.runner.Runner.<clinit>(Runner.java:22)
at ... (other JUnit and IDE-specific entries)

The attached zip file should allow you to reproduce it (I used IntelliJ IDEA, but should work with Eclipse too, provided you add "-javaagent:jacocoagent.jar" to the JVM command line). For more details, see the original issue in the JMockit project: http://code.google.com/p/jmockit/issues/detail?id=239

This can only be solved on JaCoCo's side, I suspect, but I am willing to make changes to JMockit if needed. Let me know you need anything more. Thanks.

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2012-08-21

    IDEA/Eclipse Maven-based project

     
  • Marc R. Hoffmann

    From the partial stack trace I can't see a deadlock. This would require at least another thread waiting for a lock. Can you please attach the full stack dump?

    BTW, Method AbstractRuntime.disconnect() has been introduced to initialize internal JaCoCo data fields for redefined classes, see:

    https://sourceforge.net/tracker/?func=detail&aid=3495990&group_id=177969&atid=883351

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2012-08-22

    Full thread dump after 30 seconds of waiting

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2012-08-22

    I attached a full thread dump.

    This is the IDEA command line through which the test run was executed:

    E:\Java\jdk1.7.0_06\bin\java -javaagent:/Java/jacoco-0.5.10/lib/jacocoagent.jar -Didea.launcher.port=7561 -Didea.launcher.bin.path=E:\Java\IDEA-120.305\bin -Dfile.encoding=UTF-8 -classpath E:\Java\IDEA-120.305\lib\idea_rt.jar;E:\Java\IDEA-120.305\plugins\junit\lib\junit-rt.jar;E:\Java\jdk1.7.0_06\jre\lib\rt.jar;E:\issues-others\issue239\target\test-classes;E:\issues-others\issue239\target\classes;E:\.m2\repository\com\googlecode\jmockit\jmockit\0.999.16\jmockit-0.999.16.jar;E:\.m2\repository\junit\junit\4.8.2\junit-4.8.2.jar com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 MyTest

     
    Last edit: Anonymous 2014-11-01
  • Jim Showalter

    Jim Showalter - 2012-10-10

    Windows 7 64-bit, all patches
    Eclipse 4.2
    EclEmma 2.1.4
    JDK 1.7.0_04
    JMockit 0.999.15

    .classpath order:
    <classpathentry kind="var" path="QBO_SRC/qbo/test/dependencies/target/lib/jmockit-0.999.15.jar"/>
    <classpathentry kind="var" path="QBO_SRC/qbo/test/dependencies/target/lib/junit-4.8.2.jar"/>

    ====================================================================

    Without -javaagent, hangs.

    Killing it by clicking red square on right above console kills the job, and puts up two dialogs (Error1.jpg and Error2.jpg).

    When it is hung, running JPS outputs the following:

    ==================================

    C:\jdk1.7.0_04>jps
    11532 Jps
    15912 (Eclipse)
    15924 RemoteTestRunner

    ==================================

    C:\jdk1.7.0_04>jstack 15924

    (never returns, just hangs)

    ==================================

    C:\jdk1.7.0_04>jstack 15912

    2012-10-09 17:43:54
    Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.0-b21 mixed mode):

    "Worker-18" prio=6 tid=0x0000000011d3e800 nid=0x43a8 in Object.wait() [0x000000000e8df000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e0340d70> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
    - locked <0x00000000e0340d70> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)

    "Worker-17" prio=6 tid=0x0000000011d46800 nid=0x4390 in Object.wait() [0x000000000eb5f000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e0340d70> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
    - locked <0x00000000e0340d70> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)

    "Worker-16" prio=6 tid=0x0000000011d43800 nid=0x418c in Object.wait() [0x000000001434f000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e0340d70> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
    - locked <0x00000000e0340d70> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)

    "ServerConnection" prio=6 tid=0x0000000011d45000 nid=0x3420 runnable [0x000000001474e000]
    java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:150)
    at java.net.SocketInputStream.read(SocketInputStream.java:121)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
    - locked <0x00000000f8e52c98> (a java.io.InputStreamReader)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:154)
    at java.io.BufferedReader.read(BufferedReader.java:175)
    - locked <0x00000000f8e52c98> (a java.io.InputStreamReader)
    at java.io.FilterReader.read(FilterReader.java:65)
    at java.io.PushbackReader.read(PushbackReader.java:90)
    - locked <0x00000000f8e52c68> (a java.io.BufferedReader)
    at org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient.readMessage(RemoteTestRunnerClient.java:350)
    at org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient.access$26(RemoteTestRunnerClient.java:347)
    at org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient$ServerConnection.run(RemoteTestRunnerClient.java:270)

    "Process monitor" daemon prio=6 tid=0x0000000011d3d800 nid=0x3e60 runnable [0x000000001464f000]
    java.lang.Thread.State: RUNNABLE
    at java.lang.ProcessImpl.waitForInterruptibly(Native Method)
    at java.lang.ProcessImpl.waitFor(ProcessImpl.java:252)
    at org.eclipse.debug.core.model.RuntimeProcess$ProcessMonitorThread.run(RuntimeProcess.java:417)

    "Input Stream Monitor" daemon prio=6 tid=0x0000000011d3f000 nid=0x3290 in Object.wait() [0x0000000012b4f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000f8e54e90> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:503)
    at org.eclipse.debug.internal.core.InputStreamMonitor.writeNext(InputStreamMonitor.java:154)
    - locked <0x00000000f8e54e90> (a java.lang.Object)
    at org.eclipse.debug.internal.core.InputStreamMonitor.write(InputStreamMonitor.java:124)
    at org.eclipse.debug.internal.core.InputStreamMonitor$1.run(InputStreamMonitor.java:99)
    at java.lang.Thread.run(Thread.java:722)

    "Output Stream Monitor" daemon prio=2 tid=0x0000000011d41800 nid=0x3c20 runnable [0x000000000ef5f000]
    java.lang.Thread.State: RUNNABLE
    at java.io.FileInputStream.readBytes(Native Method)
    at java.io.FileInputStream.read(FileInputStream.java:242)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
    - locked <0x00000000f8e55050> (a java.io.BufferedInputStream)
    at java.io.FilterInputStream.read(FilterInputStream.java:107)
    at org.eclipse.debug.internal.core.OutputStreamMonitor.read(OutputStreamMonitor.java:145)
    at org.eclipse.debug.internal.core.OutputStreamMonitor.access$1(OutputStreamMonitor.java:135)
    at org.eclipse.debug.internal.core.OutputStreamMonitor$1.run(OutputStreamMonitor.java:208)
    at java.lang.Thread.run(Thread.java:722)

    "Output Stream Monitor" daemon prio=2 tid=0x0000000011d3d000 nid=0x5cc runnable [0x000000000ec5f000]
    java.lang.Thread.State: RUNNABLE
    at java.io.FileInputStream.readBytes(Native Method)
    at java.io.FileInputStream.read(FileInputStream.java:242)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
    - locked <0x00000000f8e4b788> (a java.io.BufferedInputStream)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
    - locked <0x00000000f8e4da58> (a java.io.BufferedInputStream)
    at java.io.FilterInputStream.read(FilterInputStream.java:107)
    at org.eclipse.debug.internal.core.OutputStreamMonitor.read(OutputStreamMonitor.java:145)
    at org.eclipse.debug.internal.core.OutputStreamMonitor.access$1(OutputStreamMonitor.java:135)
    at org.eclipse.debug.internal.core.OutputStreamMonitor$1.run(OutputStreamMonitor.java:208)
    at java.lang.Thread.run(Thread.java:722)

    "Worker-10" prio=6 tid=0x0000000011d43000 nid=0x1690 runnable [0x00000000160ff000]
    java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:150)
    at java.net.SocketInputStream.read(SocketInputStream.java:121)
    at java.net.SocketInputStream.read(SocketInputStream.java:203)
    at java.io.DataInputStream.readByte(DataInputStream.java:265)
    at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:80)
    at com.mountainminds.eclemma.internal.core.MemoryExecutionDataSource.readFrom(MemoryExecutionDataSource.java:68)
    at com.mountainminds.eclemma.internal.core.launching.AgentServer.run(AgentServer.java:114)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

    "Worker-6" prio=6 tid=0x0000000011d40000 nid=0x2098 in Object.wait() [0x0000000015fff000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000f8e57270> (a org.eclipse.ui.console.IOConsoleInputStream)
    at java.lang.Object.wait(Object.java:503)
    at org.eclipse.ui.console.IOConsoleInputStream.waitForData(IOConsoleInputStream.java:147)
    at org.eclipse.ui.console.IOConsoleInputStream.read(IOConsoleInputStream.java:92)
    - locked <0x00000000f8e57270> (a org.eclipse.ui.console.IOConsoleInputStream)
    at org.eclipse.ui.console.IOConsoleInputStream.read(IOConsoleInputStream.java:117)
    at org.eclipse.debug.internal.ui.views.console.ProcessConsole$InputReadJob.run(ProcessConsole.java:678)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

    "[ThreadPool Manager] - Idle Thread" daemon prio=6 tid=0x000000000cdfa000 nid=0x3e2c in Object.wait() [0x000000001179f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e5a5d360> (a org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor)
    at java.lang.Object.wait(Object.java:503)
    at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:106)
    - locked <0x00000000e5a5d360> (a org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor)

    "org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon prio=2 tid=0x000000000cdfe800 nid=0x34c4 in Object.wait() [0x000000001489f000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e37b16f0> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)
    at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:179)
    - locked <0x00000000e37b16f0> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

    "Java indexing" daemon prio=4 tid=0x000000000cdf8800 nid=0x3838 in Object.wait() [0x000000001113f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e3b32c60> (a org.eclipse.jdt.internal.core.search.indexing.IndexManager)
    at java.lang.Object.wait(Object.java:503)
    at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:382)
    - locked <0x00000000e3b32c60> (a org.eclipse.jdt.internal.core.search.indexing.IndexManager)
    at java.lang.Thread.run(Thread.java:722)

    "Bundle File Closer" daemon prio=6 tid=0x000000000bb26000 nid=0x3670 in Object.wait() [0x000000000ed5f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e2e2a4a0> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at java.lang.Object.wait(Object.java:503)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:400)
    - locked <0x00000000e2e2a4a0> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:336)

    "Worker-JM" prio=6 tid=0x000000000c7c1000 nid=0x3dfc in Object.wait() [0x000000000d5cf000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e0341080> (a java.util.ArrayList)
    at org.eclipse.core.internal.jobs.InternalWorker.run(InternalWorker.java:58)
    - locked <0x00000000e0341080> (a java.util.ArrayList)

    "[Timer] - Main Queue Handler" daemon prio=6 tid=0x000000000be47000 nid=0x3260 in Object.wait() [0x000000000d34f000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e032af48> (a java.lang.Object)
    at org.eclipse.equinox.internal.util.impl.tpt.timer.TimerImpl.run(TimerImpl.java:141)
    - locked <0x00000000e032af48> (a java.lang.Object)
    at java.lang.Thread.run(Thread.java:722)

    "Framework Event Dispatcher" daemon prio=6 tid=0x000000000bbef000 nid=0x3c08 in Object.wait() [0x000000000d4cf000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e0389570> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at java.lang.Object.wait(Object.java:503)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:400)
    - locked <0x00000000e0389570> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:336)

    "Start Level Event Dispatcher" daemon prio=6 tid=0x000000000bf7f800 nid=0x3d5c in Object.wait() [0x000000000d14f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e03a3f70> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at java.lang.Object.wait(Object.java:503)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:400)
    - locked <0x00000000e03a3f70> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:336)

    "State Data Manager" daemon prio=6 tid=0x000000000bb6f800 nid=0x3eb0 waiting on condition [0x000000000c07f000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at org.eclipse.osgi.internal.baseadaptor.StateManager.run(StateManager.java:297)
    at java.lang.Thread.run(Thread.java:722)

    "Framework Active Thread" prio=6 tid=0x000000000b969000 nid=0x3d44 in Object.wait() [0x000000000b60f000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e0b93a80> (a org.eclipse.osgi.framework.internal.core.Framework)
    at org.eclipse.osgi.framework.internal.core.Framework.run(Framework.java:1863)
    - locked <0x00000000e0b93a80> (a org.eclipse.osgi.framework.internal.core.Framework)
    at java.lang.Thread.run(Thread.java:722)

    "Service Thread" daemon prio=6 tid=0x000000000a94c800 nid=0x3fb0 runnable [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE

    "C2 CompilerThread1" daemon prio=10 tid=0x000000000a943000 nid=0x3fec waiting on condition [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE

    "C2 CompilerThread0" daemon prio=10 tid=0x000000000a93c000 nid=0x3954 waiting on condition [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE

    "Attach Listener" daemon prio=10 tid=0x000000000a93b000 nid=0x3ecc runnable [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE

    "Signal Dispatcher" daemon prio=10 tid=0x000000000a93a000 nid=0x32d4 runnable [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE

    "Finalizer" daemon prio=8 tid=0x0000000008a18800 nid=0x3830 in Object.wait() [0x000000000a8ef000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e024a288> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
    - locked <0x00000000e024a288> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)

    "Reference Handler" daemon prio=10 tid=0x0000000008a10000 nid=0x3d74 in Object.wait() [0x000000000a7ef000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00000000e0249d98> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:503)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
    - locked <0x00000000e0249d98> (a java.lang.ref.Reference$Lock)

    "main" prio=6 tid=0x0000000002e5c800 nid=0x3fe0 runnable [0x000000000012e000]
    java.lang.Thread.State: RUNNABLE
    at org.eclipse.swt.internal.win32.OS.WaitMessage(Native Method)
    at org.eclipse.swt.widgets.Display.sleep(Display.java:4656)
    at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:364)
    at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.eventLoopIdle(IDEWorkbenchAdvisor.java:917)
    at org.eclipse.ui.internal.Workbench$3.eventLoopIdle(Workbench.java:459)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1026)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

    "VM Thread" prio=10 tid=0x0000000008a08000 nid=0x3ad0 runnable

    "GC task thread#0 (ParallelGC)" prio=6 tid=0x0000000002da3000 nid=0x3c2c runnable

    "GC task thread#1 (ParallelGC)" prio=6 tid=0x0000000002da5000 nid=0x3d1c runnable

    "GC task thread#2 (ParallelGC)" prio=6 tid=0x0000000002da6800 nid=0x3f98 runnable

    "GC task thread#3 (ParallelGC)" prio=6 tid=0x0000000002da8000 nid=0x3e90 runnable

    "GC task thread#4 (ParallelGC)" prio=6 tid=0x0000000002dab800 nid=0x3878 runnable

    "GC task thread#5 (ParallelGC)" prio=6 tid=0x0000000002dad000 nid=0x3ff4 runnable

    "GC task thread#6 (ParallelGC)" prio=6 tid=0x0000000002dae000 nid=0x3a70 runnable

    "GC task thread#7 (ParallelGC)" prio=6 tid=0x0000000002daf800 nid=0x3de8 runnable

    "VM Periodic Task Thread" prio=10 tid=0x000000000a96d000 nid=0x3f58 waiting on condition

    JNI global references: 584

    ====================================================================

    With -javaagent:C:/dev/trunk/src/qbo/test/dependencies/target/lib/jmockit-0.999.15.jar

    ==================================

    Runs for a while, then Eclipse console displays:

    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000077cc32d0, pid=16092, tid=17144
    #
    # JRE version: 7.0_04-b20
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0-b21 mixed mode windows-amd64 compressed oops)
    # Problematic frame:
    # [thread 17364 also had an error]
    C [ntdll.dll+0x532d0] RtlFreeHeap+0xd0
    #
    # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
    #
    # An error report file with more information is saved as:
    # C:\dev\trunk\eclipse\test\hs_err_pid16092.log
    [thread 15992 also had an error]
    #
    # If you would like to submit a bug report, please visit:
    # http://bugreport.sun.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    Killing it by clicking red square on right above console kills the job, and puts up same two dialogs (Error1.jpg and Error2.jpg).

    Sometimes before I can kill it, Windows pops up a JVM-has-crashed dialog and asks if I want to shut down Eclipse.

     
  • Jim Showalter

    Jim Showalter - 2012-10-10

    Unfortunately, I don't seem to be able to attach files, so here is what Error1.jpg and Error2.jpg would have shown you.

    Error1.jpg:

    No coverage data has been collected during this coverage session.

    Please do not terminate the Java process manually from Eclipse.

    Error2.jpg:

    'com.mountainminds.eclemma.internal.core.launching.AgentServer' has encountere a problem.

    Error while dumping coverage data (code 5013).

    Connection reset

    Forgot to mention I'm using 64-bit JDK.

     
  • Stephen

    Stephen - 2012-10-19

    According to this thread: https://github.com/jacoco/eclemma/issues/9
    then when threads deadlock on a static initializer then they still show up as RUNNABLE.

     
  • Stephen

    Stephen - 2012-10-19

    A work-around was found and documented here: https://code.google.com/p/jmockit/issues/detail?id=239#c6

    It looks like it's an issue with how JaCoCo and jMockit are both using the Attach API.
    I've verified that the workaround provided by jmockit works. However, it'd be awesome to not have to do that.

     
  • Jim Showalter

    Jim Showalter - 2012-10-19

    "A work-around was found and documented here:
    https://code.google.com/p/jmockit/issues/detail?id=239#c6"

    Unfortunately, that workaround doesn't work, which is why I keep pressing on this issue. It works okay for small test cases, but not for our large, real project.

    I will try to create a reduced test case that exhibits the problem.

     
  • Stephen

    Stephen - 2012-10-24

    You're right - the work-around only works for simple cases. It doesn't work for more realistic cases.
    I just ran into:

    java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the schema (add/remove fields)
    at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

     
  • Jim Showalter

    Jim Showalter - 2012-11-11

    Is this not ever going to be fixed? Two of my favorite tools no longer coexist, they used, to (so it's a recent regression), and progress on fixing the problem seems to be nonexistent.