Invalid execution data file

1,137 views
Skip to first unread message

YEV

unread,
Aug 6, 2018, 4:53:23 AM8/6/18
to JaCoCo and EclEmma Users
My process created  an exec file while trying to generate a report from it, getting an error:

Exception in thread "main" java.io.IOException: Invalid execution data file.
at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:125)
at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:109)
at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:92)


readHeader() method is expecting the first char to be  49344
But in my case it's 16191 - is there any meaning for this value?

Marc Hoffmann

unread,
Aug 6, 2018, 6:32:01 AM8/6/18
to jac...@googlegroups.com

Hi,

exec files are an internal binary format used by JaCoCo. If it does not have a valid header this means

a) it is not an exec file written by the JaCoCo agent (or a dump command) or
b) the file was modified afterwards

How do you create the exec file?

Regards,
-marc

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/7ea84c9a-9a94-495a-a09c-0a2750f78632%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


YEV

unread,
Aug 6, 2018, 6:58:19 AM8/6/18
to JaCoCo and EclEmma Users
by attaching agent to the java process

javaagent:lib/jacocoagent.jar=destfile=/execs/jacoco.exec,output=file,append=true


(multiple java process are executed - one after another, not in same time)

Dhruv Vinayak

unread,
Aug 6, 2018, 7:25:04 AM8/6/18
to jac...@googlegroups.com
Even i'm facing the same issue for a java process. It seems the exec
file is getting corrupt in between or the java process is not getting
stopped cleanly. Just a thought, may be the corresponding thread which
handles writing data to exec file gets killed before the jvm is
shutdown properly. Not sure, its just a thought. May be experts here
can provide their view and solution.

Regards,
Dhruv Vinayak
> To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/151491be-dd5f-480f-a188-d303869391ee%40googlegroups.com.

Marc Hoffmann

unread,
Aug 6, 2018, 8:00:56 AM8/6/18
to jac...@googlegroups.com

Can't tell what causes the invalid content in your exec file. Can you please provide a example of such a corrupted file?

Regards,
-marc

Marc Hoffmann

unread,
Aug 6, 2018, 8:04:45 AM8/6/18
to jac...@googlegroups.com
Hi Dhruv,

when the Java process is killed before the data can be written the exec
file gets trunkated. This typically results in a different error
message.

Can you please provide the full stack trace in your case?

Regards,
-marc

Evgeny Mandrikov

unread,
Aug 6, 2018, 8:14:17 AM8/6/18
to JaCoCo and EclEmma Users
Hi,

The only known to us case of improper execution of JVM shutdown hook thread in case of graceful JVM termination - is a JVM bug https://bugs.openjdk.java.net/browse/JDK-8154017 when main thread is left in interrupted state.
This was fixed in JDK 9 and backported to JDK 8, AFAIR to 8u162.
Thus please
  • make sure that JVM is gracefully terminated and not killed
  • check JVM version that you use
  • and state in which you leave main thread
> To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages