Stack overflow/infinite recursion in jacocoInit?

662 views
Skip to first unread message

Benson Margulies

unread,
Jan 20, 2014, 3:54:32 PM1/20/14
to jac...@googlegroups.com

Running with maven, sonar, and jacoco, 0.6.4.201312101107, I'm got infinite recursion in Jacoco init. Help?

build	20-Jan-2014 14:44:57	[INFO] [14:44:57.700] JVM options: -javaagent:/tmp/TEJ-SCC0-JOB1/jacocoagent745021511850219605.jar=destfile=target/jacoco.exec,excludes=*_javassist_* -Dfile.encoding=utf-8 -Xmx2g ${jaCoCoSurefireArgLine}
build	20-Jan-2014 14:44:57	[INFO] [14:44:57.735] Initializer FindbugsMavenInitializer...
build	20-Jan-2014 14:44:57	[INFO] [14:44:57.743] Initializer FindbugsMavenInitializer done: 8 ms
build	20-Jan-2014 14:44:57	[INFO] [14:44:57.743] Execute maven plugin maven-surefire-plugin...
build	20-Jan-2014 14:44:57	[INFO] [14:44:57.744] Execute org.apache.maven.plugins:maven-surefire-plugin:2.12:test...
build	20-Jan-2014 14:44:57	[INFO]                                                                         
build	20-Jan-2014 14:44:57	[INFO] ------------------------------------------------------------------------
build	20-Jan-2014 14:44:57	[INFO] Building APNE decoder 1.1.104-SNAPSHOT
build	20-Jan-2014 14:44:57	[INFO] ------------------------------------------------------------------------
build	20-Jan-2014 14:44:57	[INFO] 
build	20-Jan-2014 14:44:57	[INFO] --- maven-surefire-plugin:2.12:test (default-cli) @ apne ---
build	20-Jan-2014 14:44:57	[INFO] Surefire report directory: /data/bamboo-agent-home/xml-data/build-dir/TEJ-SCC0-JOB1/apne/target/surefire-reports
build	20-Jan-2014 14:44:57	
build	20-Jan-2014 14:44:57	-------------------------------------------------------
build	20-Jan-2014 14:44:57	 T E S T S
build	20-Jan-2014 14:44:57	-------------------------------------------------------
build	20-Jan-2014 14:44:58	Exception in thread "main" java.lang.reflect.InvocationTargetException
build	20-Jan-2014 14:44:58		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
build	20-Jan-2014 14:44:58		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
build	20-Jan-2014 14:44:58		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
build	20-Jan-2014 14:44:58		at java.lang.reflect.Method.invoke(Method.java:597)
build	20-Jan-2014 14:44:58		at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
build	20-Jan-2014 14:44:58		at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
build	20-Jan-2014 14:44:58	Caused by: java.lang.StackOverflowError



I am staring at a lot of backtrace that ends with:

at org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionData.<init>(ExecutionData.java)
at org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionDataStore.get(ExecutionDataStore.java:114)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.getExecutionData(RuntimeData.java:120)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.getProbes(RuntimeData.java:148)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.equals(RuntimeData.java:162)
at org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionData.$jacocoInit(ExecutionData.java)
at org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionData.<init>(ExecutionData.java)
at org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionDataStore.get(ExecutionDataStore.java:114)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.getExecutionData(RuntimeData.java:120)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.getProbes(RuntimeData.java:148)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.equals(RuntimeData.java:162)
at org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionData.$jacocoInit(ExecutionData.java)
at org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionData.<init>(ExecutionData.java)
at org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionDataStore.get(ExecutionDataStore.java:114)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.getExecutionData(RuntimeData.java:120)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.getProbes(RuntimeData.java:148)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.RuntimeData.equals(RuntimeData.java:162)

Marc R. Hoffmann

unread,
Jan 21, 2014, 1:55:53 AM1/21/14
to jac...@googlegroups.com
Hi,

this happens if JaCoCo itself gets instrumented

  org.jacoco.agent.rt.internal_6effb9e.core.data.ExecutionData.$jacocoInit

Normally JaCoCo detects this and excludes its own classes from instrumentation. It can happen anyhow, if two different versions of JaCoCo are used at the same time. Looking at your setup it might be the case that Sonar uses a different version. AFAIK Sonar transparently adds code coverage to your project. So if you teke care about code coverage configuration yourself you migth end up with two JaCoCo agents. I think JaCoCo has an option to pick up existing exec files. I recommend looking at the Sonar documentation or asking at their user list.

Cheers,
-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.
For more options, visit https://groups.google.com/groups/opt_out.


-- 
Marc Hoffmann
hoff...@mountainminds.com
_______________________________________________
Mountainminds GmbH & Co. KG

Nussbaumstr. 4 * 80336 Muenchen * Germany 
Phone/Fax +49-700-68664637 * 0700-MTNMINDS

Registergericht Muenchen * HRA 80201
Mountainminds Verwaltungs GmbH
Registergericht Muenchen * HRB 143183
Geschaeftsfuehrer Marc Hoffmann

Mirko Friedenhagen

unread,
Jan 21, 2014, 6:22:42 AM1/21/14
to jac...@googlegroups.com

Hello,

there is a sonar option (do not remember the name/key) with value dynamicReports where sonar will take the coverage results from a previous maven run instead of invoking the tests again (useful for inclusion of integration test coverage as well).

Regards
Mirko
--
Sent from my mobile

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages