Menu

#127 MetaData.readExternal() believes I have 946040685 classes and then OOMs.

open
nobody
None
5
2014-01-16
2013-09-18
No

(1) [EMMA v2.0, build 15217 (unsupported private build)]
(2) java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

This is the version of EMMA I am using as part of Buck: https://github.com/facebook/buck

Here is the command I have been running to produce the report:

java -Xmx1024M -classpath /home/mbolin/devtools/buck/third-party/java/emma-2.0.5312/out/emma-2.0.5312.jar emma report '-Dreport.out.dir=buck-out/gen/emma' -report html -report xml -report txt -input buck-out/gen/emma/coverage.ec,buck-out/gen/emma/coverage.em -sourcepath ./src/,./src/com/facebook/buck/test/,./test/

And here is the error that I see:

[EMMA v2.0, build 15217 (unsupported private build)]
emma report: unexpected failure: 
Exception in thread "main" com.vladium.emma.EMMARuntimeException: unexpected failure: 
    at com.vladium.emma.Command.exit(Command.java:237)
    at com.vladium.emma.report.reportCommand.run(reportCommand.java:145)
    at emma.main(emma.java:40)
Caused by: java.lang.OutOfMemoryError: Java heap space
    at java.util.HashMap.<init>(HashMap.java:283)
    at java.util.HashMap.<init>(HashMap.java:297)
    at com.vladium.emma.data.MetaData.readExternal(MetaData.java:223)
    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)
    ... 1 more

When I added some debug statements, I see that it occurs in the following code in MetaData.java:

    final int size = in.readInt ();
    final HashMap classMap = new HashMap (size);

The value that emma is reading for the size is 946040685, so it OOMs when it tries to create the HashMap. The weird thing is that this failure does not happen reliably: sometimes I can re-create the report from scratch and everything works out.

This makes me think that the way in which EMMA produces this report is not stable. Because coverage.ec is a binary file format, I find this impossible to debug.

2 Attachments

Discussion


Log in to post a comment.