Menu

#132 Unexpected frames result in invalid class files

closed-fixed
nobody
JaCoCo (32)
9
2012-08-01
2012-07-13
Derek
No

I just updated to the latest EclEmma plugin (which includes JaCoCo 0.5.8) and I'm now able to reproduce a severe regression in JaCoCo in both Eclipse and via our builds. In both cases, we get an error that looks like this:
java.lang.ClassFormatError: StackMapTable format error: bad verification type
and then at some point the JVM will crash.

Discussion

<< < 1 2 (Page 2 of 2)
  • Marc R. Hoffmann

    Can you please add the stack trace and/or error message?

     
  • Derek

    Derek - 2012-07-25

    The JVM crashes.

    It says:
    'com.mountainminds.eclemma.internal.core.launching.AgentServer' has encountered a problem.

    Error while dumping coverage data (code 5013).

    Exception Stack Trace:
    java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.DataInputStream.readByte(Unknown Source)
    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)

    Session Data:
    eclipse.buildId=I20120608-1400
    java.version=1.7.0_05
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments: -product org.eclipse.epp.package.java.product
    Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

     
  • Derek

    Derek - 2012-07-25

    the JVM crash report

     
  • Marc R. Hoffmann

    Does the JVM write a *.pid file?

     
  • Derek

    Derek - 2012-07-25

    Yup - I attached one of them to the bug.

     
  • Marc R. Hoffmann

    Hm, so you only get the pid file? No exceptions, no messages on the console?

    The pid reports "ParallelGCFailedPermanentAllocation". The memory overhead given by JaCoCo should be minimal, but you might try to allocate more heap for your test.

     
  • Derek

    Derek - 2012-07-25

    The JVM crashes, a pid file is created, and I see the normal Java crash error in the console:
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006dc7a01a, pid=1300, tid=6368
    #
    # JRE version: 6.0_33-b03
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.8-b03 mixed mode windows-amd64 compressed oops)
    # Problematic frame:
    # V [jvm.dll+0x3ca01a]
    #
    # An error report file with more information is saved as:
    # H:\git\hedgehog\core\Commons\hs_err_pid1300.log
    #
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    #

    I tried running with (a lot) more memory but it didn't seem to make a difference. It still crashes in the same place every time (it's the classfile I attached previously - in the testDontFreeMemoryCorrectly method).

    The code looks like this:
    @SuppressWarnings("DLS_DEAD_LOCAL_STORE_OF_NULL")
    @Test
    public void testDontFreeMemoryCorrectly() {
    ReferenceQueue<BasicModel> queue = new ReferenceQueue<BasicModel>();

    BasicModel testModel = new BasicModel();

    BasicModel child1 = new BasicModel();
    testModel.setChildModel(child1);

    WeakReference<BasicModel> ref = new WeakReference<BasicModel>(testModel, queue);

    testModel = null;

    System.gc();

    assertFalse(ref.isEnqueued());
    }

    When I comment out the System.gc() call, it works fine. So that seems to be triggering the crash somehow. I then let the test suite run a bit longer (it's a big test suite) and it broke again later on. I've attached that pid file as well so you can see some diversity in the crashes I'm encountering.

     
  • Derek

    Derek - 2012-07-25

    another crash in a class called PdfExportManagerTests

     
  • Marc R. Hoffmann

    And this kind of crash does definitely not happen if you don't specify JaCoCo as an Java agent?

     
  • Derek

    Derek - 2012-07-25

    Nope, it definitely seems to be related to the latest JaCoCo release. We used it pretty extensively previously without any issues.

     
  • Derek

    Derek - 2012-07-25

    We also only see the issue when running with JaCoCo. It is fine otherwise. We also still use the old version of JaCoCo in our builds and it works great.

     
  • Marc R. Hoffmann

    • status: open --> closed-fixed
     
  • Marc R. Hoffmann

    Fixed in EclEmma 2.1.4.

     
<< < 1 2 (Page 2 of 2)