Menu

UTFDataFormatException

Anonymous
2004-05-25
2013-05-09
  • Anonymous

    Anonymous - 2004-05-25

    Hi,

    I am trying to use emma in the offline mode. I got the following exception when I tried to generate the report:
    java.io.UTFDataFormatException
            at java.io.DataInputStream.readUTF(DataInputStream.java:656)
            at java.io.DataInputStream.readUTF(DataInputStream.java:610)
            at com.vladium.emma.data.ClassDescriptor.readExternal(ClassDescriptor.java:171)
            at com.vladium.emma.data.MetaData.readExternal(MetaData.java:187)
            at com.vladium.emma.data.DataFactory.readEntry(DataFactory.java:768)
            at com.vladium.emma.data.DataFactory.mergeload(DataFactory.java:461)
            at com.vladium.emma.data.DataFactory.load(DataFactory.java:57)
            at com.vladium.emma.report.ReportProcessor.run(ReportProcessor.java:138)
            at com.vladium.emma.report.reportCommand.run(reportCommand.java:128)
            at emma.main(emma.java:45)

    Command used to generate report was:
    java -cp "d:\emma\emma.jar" emma report -r html -in coverage.em,coverage.ec

    What could be the problem?

     
    • Vlad Roubtsov

      Vlad Roubtsov - 2004-05-25

      Swati,
          One of your input files is corrupt, although why that would happen I don't know off the top of my head. Help me by giving me more data:

      (1) what were your exact steps to generate coverage.em and coverage.ec files?

      (2) can you add "-debug:trace3" option to the report command and post the resulting output?

      Thanks,
      Vlad.

       
    • Anonymous

      Anonymous - 2004-05-26

      Hi Vlad,

      Thanks for your reply. Here are a few details:

      The application runs on tomcat webserver. Application classes are jarred into file 'pi.jar'.
      Ant is used for building the application but not for running it. Application is launched using the following commandline:
      C:\j2sdk1.4.1\bin\java.exe -hotspot -ms256m -jar -Duser.dir="C:\Program Files\Apache Group\Tomcat 4.1" "C:\Program Files\Apache Group\Tomcat 4.1\bin\bootstrap.jar" start

      Steps followed for generating the coverage.em and coverage.ec files are:
      1. Copied emma.jar to $application_dir\web-inf\lib.
      2. Commandline: java -cp "$application_dir\web-inf\lib\emma.jar" emma instr -m overwrite -cp $application_dir\web-inf\lib\pi.jar
          This instrumented the pi.jar classes and gave me coverage.em.
      3. Commandline:
          C:\j2sdk1.4.1\bin\java.exe -hotspot -ms256m -mx512m -cp "$application_dir\web-inf\lib\emma.jar" emmarun -r html -jar -Duser.dir="C:\Program Files\Apache Group\Tomcat 4.1" "C:\Program Files\Apache Group\Tomcat 4.1\bin\bootstrap.jar" start
         I got the messages:
          collecting runtime coverage data ...
          runtime coverage data merged into [C:\Program Files\Apache Group\Tomcat 4.1\coverage.ec] {in 63 ms}
          This gave me coverage.ec file.
      4. Commandline:java -cp "$application_dir\web-inf\lib\emma.jar" emma report -r html -in coverage.em,coverage.ec
          This gave me the UTFDataFormatException.

      Could you direct me to instructions on how to use the commandline option for the on-the-fly feature of emma when the application runs on tomcat webserver?

       
    • Anonymous

      Anonymous - 2004-05-26

      Hi Vlad,

      I could generate the report when I tried it afresh. Looks like the file corruption happened because I tried to generate the report while tomcat was still running.

      thanks,
      Swati

       
    • Vlad Roubtsov

      Vlad Roubtsov - 2004-05-26

      Ah, I am glad it's sorted out. Right now, EMMA dumps coverage only when main() exits (and all non-deamon threads are done) or when the JVM exit hooks are run(*). So, in your case you need to shut tomcat down to generage the coverage dump.

      Using the on-the-fly feature will not work with tomcat: tomcat is precisely one of those runtimes that do their own classloading and that breaks emmarun (see http://emma.sourceforge.net/reference/ch02s02.html#N1020C for a few more comments about this). Not breaks it exactly, but it makes emmarun not notice your app classes because tomcat's web classloader loads them itself (from WEB-INF/classes etc). On-the-fly mode is really for simple(r) apps (command line, Swing, test frameworks, etc) but it's next to impossible to make it work reliably for "big" J2EE containers.

      Vlad.

      (*) Technically, there is an internal EMMA runtime API that you could hook into programmatically to cause a runtime dump wihtout a full JVM shutdown. I may publish more details if there is demand.

       
    • Nobody/Anonymous

      I am also getting a UTFDataFormatException, and I don't know why. I am not using tomcat.

      I use ant for compilation.
      I have changed my build.xml to include this:

      <emma enabled="${emma.enabled}" >
            <instr instrpath="${jarfile}"
                   mode="overwrite"
           metadatafile="${emmaOutDir}/metadata.emma"
            merge="true"
            />
          </emma>

      and I compile using
      "ant emma"

      which generates my metadata.emma file

      I then run a unit test using this command

      /usr/local/.version/j2sdk1.4.2/bin/java -Xms500000k -Xmx2500000k -classpath <my-path>
      -Xbootclasspath <path> -D<app-specific props>
      -Demma.coverage.out.file=/u/lillian/cvs/head/emma/coverage.emma
      junit.textui.TestRunner <myclass>

      I then typed
      /usr/local/.version/j2sdk1.4.2/bin/java -Xms500000k -Xmx2500000k -classpath <my-path>
      -Xbootclasspath <path> -D<app-specific props>
      emma report -debug:trace3 -in emma/coverage.emma -in emma/metadata.emma -r txt

      and I got:

      EMMA: [emma.Processor::run] complete tool properties:
      coverage.out.file:      [/u/lillian/cvs/head/emma/coverage.emma]
      coverage.out.merge:     [true]
      instr.do_suid_compensation:     [true]
      instr.exclude_bridge_methods:   [true]
      instr.exclude_synthetic_methods:        [true]
      metadata.out.file:      [coverage.em]
      metadata.out.merge:     [true]
      report.columns: [name,class,method,block,line]
      report.depth:   [method]
      report.html.out.encoding:       [ISO-8859-1]
      report.html.out.file:   [coverage/index.html]
      report.metrics: [method:70,block:80,line:80,class:100]
      report.out.dir: [/net/fsdv2/u-3/lillian/cvs/head]
      report.out.encoding:    [ISO-8859-1]
      report.sort:    [+block,+name,+method,+class]
      report.txt.columns:     [class,method,block,line,name]
      report.txt.depth:       [all]
      report.txt.out.file:    [coverage.txt]
      report.units:   [instr]
      report.xml.out.encoding:        [UTF-8]
      report.xml.out.file:    [coverage.xml]
      session.out.file:       [coverage.es]
      session.out.merge:      [true]
      verbosity.level:        [trace3]
      EMMA: [EMMA v2.0, build 4217 (2004/07/17 12:19:29)]
      EMMA: input data path:
      EMMA: {
      EMMA:   /net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma
      EMMA:   /net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma
      EMMA: }
      EMMA: source path not set
      EMMA: processing input file [/net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma] ...
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma]: file length = 26569
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma]: position 24
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma]: found valid entry of size 26536 and type 1
      EMMA: [emma.data.DataFactory::mergeload] entry read in 16 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma]: position 26569
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma]: file processed in 18 ms
      EMMA:   loaded 145 coverage data entries
      EMMA: processing input file [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] ...
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: file length = 2835843
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 24
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 19190 and type 0
      EMMA: [emma.data.DataFactory::mergeload] entry read in 14 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 19223
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 174765 and type 0
      java.io.UTFDataFormatException
              at java.io.DataInputStream.readUTF(DataInputStream.java:674)
              at java.io.DataInputStream.readUTF(DataInputStream.java:610)
              at com.vladium.emma.data.MetaData.readExternal(MetaData.java:227)
              at com.vladium.emma.data.DataFactory.readEntry(DataFactory.java:770)
              at com.vladium.emma.data.DataFactory.mergeload(DataFactory.java:461)
              at com.vladium.emma.data.DataFactory.load(DataFactory.java:56)
              at com.vladium.emma.report.ReportProcessor._run(ReportProcessor.java:175)
              at com.vladium.emma.Processor.run(Processor.java:54)
              at com.vladium.emma.report.reportCommand.run(reportCommand.java:130)
              at emma.main(emma.java:40)

      What am I doing wrong?

       
    • Vlad Roubtsov

      Vlad Roubtsov - 2004-09-21

      On the face of it, you are doing nothing wrong. (I hope whatever you are putting in the boot classpath is not messing up EMMA or Java serialization.)

      Let me ask you this though: the debug trace clearly shows that there were two attempts to add metadata to "metadata.emma" (there are two entries of "type 0" in the trace).

      And in fact it looks like there were lots more attempts to merge metadata into the same file: the file size is ~3Mb and the first two entries are much smaller than that.

      Is it possible that you tried to instrument more than once and perhaps aborted some of those builds/instrumentations while EMMA was writing to metadata.emma?

      Note that because you have merge=true for metadata, it keeps accumulating all previous results in the same file. Try deleting the file to reset things to a clean state (or use merge=false).

       
    • Nobody/Anonymous

      Well, I removed my merge files. And I reran, and I got the same error: (This time, I'm printing the whole class path and the whole bootclasspath, hopefully it'll help you)

      /usr/local/.version/j2sdk1.4.2/bin/java -Xms500000k -Xmx2500000k  -classpath /u/lillian/cvs/head/lib/twosigma/analytical.jar:/u/lillian/cvs/head/lib/twosigma/apps.jar:/u/lillian/cvs/head/lib/twosigma/backoffice.jar:/u/lillian/cvs/head/lib/twosigma/core.jar:/u/lillian/cvs/head/lib/twosigma/datatools.jar:/u/lillian/cvs/head/lib/twosigma/ems.jar:/u/lillian/cvs/head/lib/twosigma/messaging.jar:/u/lillian/cvs/head/lib/twosigma/qa.jar:/u/lillian/cvs/head/lib/twosigma/tt.jar:/u/lillian/cvs/head/lib/twosigma/ui.jar:/u/lillian/cvs/head/lib/twosigma/util.jar:/u/lillian/cvs/head/lib/extjava.jar:/usr/local/vendor/mssql/lib/msbase.jar:/usr/local/vendor/mssql/lib/mssqlserver.jar:/usr/local/vendor/mssql/lib/msutil.jar:/usr/local/vendor/tibco/tibjms/java/jndi.jar:/usr/local/vendor/tibco/tibjms/java/jms.jar:/usr/local/vendor/tibco/tibjms/java/tibjms.jar:/usr/local/vendor/tibco/tibjms/java/tibjmsadmin.jar:/usr/local/vendor/tibco/tibrv/lib/tibrvj.jar:/usr/local/vendor/javelin/Appia/lib/appia.jar:/usr/local/vendor/javelin/Appia/lib/protocols/FIX.jar:/usr/local/vendor/javelin/Appia/lib/simulator.jar:/usr/local/vendor/javelin/Appia/lib/fixometer.jar:/usr/local/vendor/javelin/Appia/lib/xml4j.jar:/usr/local/vendor/javelin/Appia/lib/jmf.jar:/usr/local/vendor/javelin/Appia/lib/pro_60.jar:/usr/local/vendor/nevaobject/JavaDDE/JavaDde.jar:/usr/local/vendor/p2j/Java-5.1.jar:/usr/local/vendor/sun/j2sdkee/lib/j2ee.jar:/u/lillian/down/emma-2.0.4217/lib/emma.jar:/usr/local/vendor/aspectj/lib/aspectjrt.jar  -Xbootclasspath/p:/u/lillian/cvs/head/lib/basejava1.4.jar   -Dtwosigma.data=/u/lillian/cvs/head/data -Dtwosigma=/u/lillian/cvs/head -Dtwosigma.config=properties/Init -Djava.security.policy=/u/lillian/cvs/head/data/properties/Policy -Dtwosigma.user=lillian -Dtwosigma.localdir=/usr/local/twosigma -Djava.util.prefs.PreferencesFactory=com.twosigma.prefs.SQLPreferencesFactory -Dtwosigma.dbpool.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver -Demma.coverage.out.file=/u/lillian/cvs/head/emma/coverage.emma -Dtwosigma.exec.hostname=indv2.nyc.twosigma.com -Dtwosigma.exec.pid=24811 -Dtwosigma.exec.filename=emma emma report -debug:trace3 -in emma/metadata.emma -in emma/coverage.emma -r txt
      EMMA: [emma.Processor::run] complete tool properties:
      coverage.out.file:      [/u/lillian/cvs/head/emma/coverage.emma]
      coverage.out.merge:     [true]
      instr.do_suid_compensation:     [true]
      instr.exclude_bridge_methods:   [true]
      instr.exclude_synthetic_methods:        [true]
      metadata.out.file:      [coverage.em]
      metadata.out.merge:     [true]
      report.columns: [name,class,method,block,line]
      report.depth:   [method]
      report.html.out.encoding:       [ISO-8859-1]
      report.html.out.file:   [coverage/index.html]
      report.metrics: [method:70,block:80,line:80,class:100]
      report.out.dir: [/net/fsdv2/u-3/lillian/cvs/head]
      report.out.encoding:    [ISO-8859-1]
      report.sort:    [+block,+name,+method,+class]
      report.txt.columns:     [class,method,block,line,name]
      report.txt.depth:       [all]
      report.txt.out.file:    [coverage.txt]
      report.units:   [instr]
      report.xml.out.encoding:        [UTF-8]
      report.xml.out.file:    [coverage.xml]
      session.out.file:       [coverage.es]
      session.out.merge:      [true]
      verbosity.level:        [trace3]
      EMMA: [EMMA v2.0, build 4217 (2004/07/17 12:19:29)]
      EMMA: input data path:
      EMMA: {
      EMMA:   /net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma
      EMMA:   /net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma
      EMMA: }
      EMMA: source path not set
      EMMA: processing input file [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] ...
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: file length = 3305291
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 24
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 19190 and type 0
      EMMA: [emma.data.DataFactory::mergeload] entry read in 21 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 19223
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 212009 and type 0
      EMMA: [emma.data.DataFactory::mergeload] entry read in 50 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 231241
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 174765 and type 0
      EMMA: [emma.data.DataFactory::mergeload] entry read in 32 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 406015
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 183557 and type 0
      java.io.UTFDataFormatException
              at java.io.DataInputStream.readUTF(DataInputStream.java:656)
              at java.io.DataInputStream.readUTF(DataInputStream.java:610)
              at com.vladium.emma.data.MetaData.readExternal(MetaData.java:227)
              at com.vladium.emma.data.DataFactory.readEntry(DataFactory.java:770)
              at com.vladium.emma.data.DataFactory.mergeload(DataFactory.java:461)
              at com.vladium.emma.data.DataFactory.load(DataFactory.java:56)
              at com.vladium.emma.report.ReportProcessor._run(ReportProcessor.java:175)
              at com.vladium.emma.Processor.run(Processor.java:54)
              at com.vladium.emma.report.reportCommand.run(reportCommand.java:130)
              at emma.main(emma.java:40)

      Now, when I compile, the ant build.xml file creates each jar file you see in the classpath separately. For each one, I do this:

        <!-- a common jar task -->
        <target name="do_jar">
          <jar jarfile="${jarfile}"
               basedir="${outputDir}"
               compress="false"
               includes="${pkgs}"/>
          <emma enabled="${emma.enabled}" >
            <instr instrpath="${jarfile}"
                   mode="overwrite"
                   metadatafile="${emmaOutDir}/metadata.emma"
                   merge="true"
            />
          </emma>
        </target>

      and then I merge all the results.

      And yes, we have our own class loader, which is why I'm using this off-line instrumentation.

      Could any of this be the problem?

       
    • Nobody/Anonymous

      ok, I removed all files and retried. This time I'll give you the full classpaths.

      I typed this:
      ant emma default

      and I got

      do_jar:
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/qa.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/tt.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/ui.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/backoffice.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/messaging.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/ems.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/apps.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/analytical.jar
          [instr] processing instrumentation path ...
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/util.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/datatools.jar
            [jar] Building jar: /net/fsdv2/u-3/lillian/cvs/head/lib/twosigma/core.jar
          [instr] instrumentation path processed in 1676 ms
          [instr] [26 class(es) instrumented, 6 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 36 ms}
          [instr] processing instrumentation path ...
          [instr] processing instrumentation path ...
          [instr] processing instrumentation path ...
          [instr] processing instrumentation path ...
          [instr] processing instrumentation path ...
          [instr] processing instrumentation path ...
          [instr] processing instrumentation path ...
          [instr] processing instrumentation path ...
          [instr] instrumentation path processed in 4719 ms
          [instr] [171 class(es) instrumented, 13 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 208 ms}
          [instr] processing instrumentation path ...
          [instr] processing instrumentation path ...
          [instr] instrumentation path processed in 5406 ms
          [instr] [177 class(es) instrumented, 35 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 201 ms}
          [instr] instrumentation path processed in 6010 ms
          [instr] [208 class(es) instrumented, 34 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 156 ms}
          [instr] package [com/twosigma/performance] contains classes [ComplexPointCuts4PerfQa] without full debug info
          [instr] instrumentation path processed in 7080 ms
          [instr] [226 class(es) instrumented, 32 resource(s) copied]
          [instr] instrumentation path processed in 7184 ms
          [instr] [211 class(es) instrumented, 33 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 216 ms}
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 199 ms}
          [instr] package [com/twosigma/resolver] contains classes [_ResolverEngine_Tie] without full debug info
          [instr] instrumentation path processed in 7333 ms
          [instr] [270 class(es) instrumented, 29 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 137 ms}
          [instr] instrumentation path processed in 7595 ms
          [instr] [300 class(es) instrumented, 34 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 153 ms}
          [instr] instrumentation path processed in 6983 ms
          [instr] [434 class(es) instrumented, 75 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 111 ms}
          [instr] package [com/twosigma/marketdata/bb] contains classes [_BBRemoteInterface_Stub] without full debug info
          [instr] instrumentation path processed in 6735 ms
          [instr] [547 class(es) instrumented, 61 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 118 ms}
          [instr] instrumentation path processed in 6770 ms
          [instr] [527 class(es) instrumented, 120 resource(s) copied]
          [instr] metadata merged into [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] {in 127 ms}

      where do_jar target is set to be

        <!-- a common jar task -->
        <target name="do_jar">
          <jar jarfile="${jarfile}"
               basedir="${outputDir}"
               compress="false"
               includes="${pkgs}"/>
          <emma enabled="${emma.enabled}" >
            <instr instrpath="${jarfile}"
                   mode="overwrite"
                   metadatafile="${emmaOutDir}/metadata.emma"
                   merge="true"
            />
          </emma>
        </target>

      and it is called for each one of several jars. I merge the metadata files purposely. Maybe I should put each jar's metadata file into a separate file?

      I then typed a simple unit test

      /usr/local/.version/j2sdk1.4.2/bin/java -Xms500000k -Xmx2500000k  -classpath /u/lillian/cvs/head/lib/twosigma/analytical.jar:/u/lillian/cvs/head/lib/twosigma/apps.jar:/u/lillian/cvs/head/lib/twosigma/backoffice.jar:/u/lillian/cvs/head/lib/twosigma/core.jar:/u/lillian/cvs/head/lib/twosigma/datatools.jar:/u/lillian/cvs/head/lib/twosigma/ems.jar:/u/lillian/cvs/head/lib/twosigma/messaging.jar:/u/lillian/cvs/head/lib/twosigma/qa.jar:/u/lillian/cvs/head/lib/twosigma/tt.jar:/u/lillian/cvs/head/lib/twosigma/ui.jar:/u/lillian/cvs/head/lib/twosigma/util.jar:/u/lillian/cvs/head/lib/extjava.jar:/usr/local/vendor/mssql/lib/msbase.jar:/usr/local/vendor/mssql/lib/mssqlserver.jar:/usr/local/vendor/mssql/lib/msutil.jar:/usr/local/vendor/tibco/tibjms/java/jndi.jar:/usr/local/vendor/tibco/tibjms/java/jms.jar:/usr/local/vendor/tibco/tibjms/java/tibjms.jar:/usr/local/vendor/tibco/tibjms/java/tibjmsadmin.jar:/usr/local/vendor/tibco/tibrv/lib/tibrvj.jar:/usr/local/vendor/javelin/Appia/lib/appia.jar:/usr/local/vendor/javelin/Appia/lib/protocols/FIX.jar:/usr/local/vendor/javelin/Appia/lib/simulator.jar:/usr/local/vendor/javelin/Appia/lib/fixometer.jar:/usr/local/vendor/javelin/Appia/lib/xml4j.jar:/usr/local/vendor/javelin/Appia/lib/jmf.jar:/usr/local/vendor/javelin/Appia/lib/pro_60.jar:/usr/local/vendor/nevaobject/JavaDDE/JavaDde.jar:/usr/local/vendor/p2j/Java-5.1.jar:/usr/local/vendor/sun/j2sdkee/lib/j2ee.jar:/u/lillian/down/emma-2.0.4217/lib/emma.jar:/usr/local/vendor/aspectj/lib/aspectjrt.jar  -Xbootclasspath/p:/u/lillian/cvs/head/lib/basejava1.4.jar  -Dtwosigma.data=/u/lillian/cvs/head/data -Dtwosigma=/u/lillian/cvs/head -Dtwosigma.config=properties/UnitTest -Djava.security.policy=/u/lillian/cvs/head/data/properties/Policy -Dtwosigma.user=lillian -Dtwosigma.localdir=/usr/local/twosigma -Djava.util.prefs.PreferencesFactory=com.twosigma.prefs.SQLPreferencesFactory -Dtwosigma.dbpool.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver -Demma.coverage.out.file=/u/lillian/cvs/head/emma/coverage.emma -Dtwosigma.exec.hostname=indv2.nyc.twosigma.com -Dtwosigma.exec.pid=32678 -Dtwosigma.exec.filename=com.twosigma.instrument.unit_tests.SplitTest junit.textui.TestRunner com.twosigma.instrument.unit_tests.SplitTest

      And I got this:

      EMMA: collecting runtime coverage data ...
      ....
      Time: 3.198

      OK (4 tests)

      EMMA: runtime coverage data merged into [/u/lillian/cvs/head/emma/coverage.emma] {in 28 ms}

      Finally, I tried to run the report:

      /usr/local/.version/j2sdk1.4.2/bin/java -Xms500000k -Xmx2500000k  -classpath /u/lillian/cvs/head/lib/twosigma/analytical.jar:/u/lillian/cvs/head/lib/twosigma/apps.jar:/u/lillian/cvs/head/lib/twosigma/backoffice.jar:/u/lillian/cvs/head/lib/twosigma/core.jar:/u/lillian/cvs/head/lib/twosigma/datatools.jar:/u/lillian/cvs/head/lib/twosigma/ems.jar:/u/lillian/cvs/head/lib/twosigma/messaging.jar:/u/lillian/cvs/head/lib/twosigma/qa.jar:/u/lillian/cvs/head/lib/twosigma/tt.jar:/u/lillian/cvs/head/lib/twosigma/ui.jar:/u/lillian/cvs/head/lib/twosigma/util.jar:/u/lillian/cvs/head/lib/extjava.jar:/usr/local/vendor/mssql/lib/msbase.jar:/usr/local/vendor/mssql/lib/mssqlserver.jar:/usr/local/vendor/mssql/lib/msutil.jar:/usr/local/vendor/tibco/tibjms/java/jndi.jar:/usr/local/vendor/tibco/tibjms/java/jms.jar:/usr/local/vendor/tibco/tibjms/java/tibjms.jar:/usr/local/vendor/tibco/tibjms/java/tibjmsadmin.jar:/usr/local/vendor/tibco/tibrv/lib/tibrvj.jar:/usr/local/vendor/javelin/Appia/lib/appia.jar:/usr/local/vendor/javelin/Appia/lib/protocols/FIX.jar:/usr/local/vendor/javelin/Appia/lib/simulator.jar:/usr/local/vendor/javelin/Appia/lib/fixometer.jar:/usr/local/vendor/javelin/Appia/lib/xml4j.jar:/usr/local/vendor/javelin/Appia/lib/jmf.jar:/usr/local/vendor/javelin/Appia/lib/pro_60.jar:/usr/local/vendor/nevaobject/JavaDDE/JavaDde.jar:/usr/local/vendor/p2j/Java-5.1.jar:/usr/local/vendor/sun/j2sdkee/lib/j2ee.jar:/u/lillian/down/emma-2.0.4217/lib/emma.jar:/usr/local/vendor/aspectj/lib/aspectjrt.jar  -Xbootclasspath/p:/u/lillian/cvs/head/lib/basejava1.4.jar   -Dtwosigma.data=/u/lillian/cvs/head/data -Dtwosigma=/u/lillian/cvs/head -Dtwosigma.config=properties/Init -Djava.security.policy=/u/lillian/cvs/head/data/properties/Policy -Dtwosigma.user=lillian -Dtwosigma.localdir=/usr/local/twosigma -Djava.util.prefs.PreferencesFactory=com.twosigma.prefs.SQLPreferencesFactory -Dtwosigma.dbpool.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver -Demma.coverage.out.file=/u/lillian/cvs/head/emma/coverage.emma -Dtwosigma.exec.hostname=indv2.nyc.twosigma.com -Dtwosigma.exec.pid=2435 -Dtwosigma.exec.filename=emma emma report -debug:trace3 -in emma/metadata.emma -in emma/coverage.emma -r txt

      And I got this:

      EMMA: [emma.Processor::run] complete tool properties:
      coverage.out.file:      [/u/lillian/cvs/head/emma/coverage.emma]
      coverage.out.merge:     [true]
      instr.do_suid_compensation:     [true]
      instr.exclude_bridge_methods:   [true]
      instr.exclude_synthetic_methods:        [true]
      metadata.out.file:      [coverage.em]
      metadata.out.merge:     [true]
      report.columns: [name,class,method,block,line]
      report.depth:   [method]
      report.html.out.encoding:       [ISO-8859-1]
      report.html.out.file:   [coverage/index.html]
      report.metrics: [method:70,block:80,line:80,class:100]
      report.out.dir: [/net/fsdv2/u-3/lillian/cvs/head]
      report.out.encoding:    [ISO-8859-1]
      report.sort:    [+block,+name,+method,+class]
      report.txt.columns:     [class,method,block,line,name]
      report.txt.depth:       [all]
      report.txt.out.file:    [coverage.txt]
      report.units:   [instr]
      report.xml.out.encoding:        [UTF-8]
      report.xml.out.file:    [coverage.xml]
      session.out.file:       [coverage.es]
      session.out.merge:      [true]
      verbosity.level:        [trace3]
      EMMA: [EMMA v2.0, build 4217 (2004/07/17 12:19:29)]
      EMMA: input data path:
      EMMA: {
      EMMA:   /net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma
      EMMA:   /net/fsdv2/u-3/lillian/cvs/head/emma/coverage.emma
      EMMA: }
      EMMA: source path not set
      EMMA: processing input file [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma] ...
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: file length = 3740342
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 24
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 19190 and type 0
      EMMA: [emma.data.DataFactory::mergeload] entry read in 21 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 19223
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 212009 and type 0
      EMMA: [emma.data.DataFactory::mergeload] entry read in 50 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 231241
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 174765 and type 0
      EMMA: [emma.data.DataFactory::mergeload] entry read in 32 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 406015
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 183557 and type 0
      EMMA: [emma.data.DataFactory::mergeload] entry read in 34 ms
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: position 589581
      EMMA: [emma.data.DataFactory::mergeload] [/net/fsdv2/u-3/lillian/cvs/head/emma/metadata.emma]: found valid entry of size 274519 and type 0
      java.io.UTFDataFormatException
              at java.io.DataInputStream.readUTF(DataInputStream.java:656)
              at java.io.DataInputStream.readUTF(DataInputStream.java:610)
              at com.vladium.emma.data.MetaData.readExternal(MetaData.java:227)
              at com.vladium.emma.data.DataFactory.readEntry(DataFactory.java:770)
              at com.vladium.emma.data.DataFactory.mergeload(DataFactory.java:461)
              at com.vladium.emma.data.DataFactory.load(DataFactory.java:56)
              at com.vladium.emma.report.ReportProcessor._run(ReportProcessor.java:175)
              at com.vladium.emma.Processor.run(Processor.java:54)
              at com.vladium.emma.report.reportCommand.run(reportCommand.java:130)
              at emma.main(emma.java:40)

       
    • Vlad Roubtsov

      Vlad Roubtsov - 2004-09-21

      I think I've got it: your build is somewhat parallelized, isn't it (<parallel>)? You are thus making concurrent writes into the same file and it can get corrupted as a result.

      There is a pending RFE to make this safer (this is safe already within the same JVM but not when processes get forked), but for now you have two options:

      (a) make the build serial. chances are it will slow things down so go to (b) instead:
      (b) make all <instr>'s write to a dedicated file, e.g.:

      <emma enabled="${emma.enabled}" >
            <instr instrpath="${jarfile}"
                   mode="overwrite"
                   metadatafile="${emmaOutDir}/metadata.${jarfile}.emma"
                   merge="true"
            />

      Then you can just report by giving to the report tool all of your split metadata files (or use the merge tool). In ANT it's especially easy because you can use a FileSet and match on ".emma" extension or something like that.

      Also, if I may I would suggest this: you don't need anything in the boot classpath or the application classpath if all you want to do is run "emma report". The only thing you need is emma.jar.

       
      • Alexey N. Solofnenko

        How is going with the parallel execution fix? I cannot run Emma without it - OutOfMemory.

        - Alexey.

         
    • Nobody/Anonymous

      Thanks! And I'm sorry to put you out, because, right after I posted your reply, I realized the same thing and I'm now in the process of doing what you suggest. I'll post again if I have more problems.

      I am aware that I don't need all the jarfiles for running the report. But I run everything through a script that sets the entire classpath for me (you think I type that whole thing by myself?) and it's easier to continue to use that script.

       

Log in to post a comment.