From fcamblor at gmail.com Mon Sep 12 04:53:01 2011 From: fcamblor at gmail.com (=?ISO-8859-1?Q?Fr=E9d=E9ric_Camblor?=) Date: Mon, 12 Sep 2011 13:53:01 +0200 Subject: Expecting a stackmap frame at branch target Message-ID: Hi everyone ! I just migrated to openjdk 7 on my project and, just after the upgrade, most of my unit test were in failure, throwing following exception : java.lang.VerifyError: Expecting a stackmap frame at branch target 81 in method fr.fsh.bbeeg.common.config.BBEEGConfiguration.()V at offset 44 When I go back to jdk 6, every tests are back to green :-) Have you any hint for solving this problem ? More inputs about my environnment : - OS : Linux ubuntu x86_64 (I encounter the same problem on my mac os x lion) - Build : Gradle 1.0 milestone 3 - Junit 4.8.2 to run unit tests - On BBEEGConfiguration constructor, I'm calling a class located in a private library, built with java source target 1.6 (but heh, openjdk 7 JRE should be able to run 1.6 classes at runtime heh ?) Full stack trace is the following : java.lang.VerifyError: Expecting a stackmap frame at branch target 81 in method fr.fsh.bbeeg.common.config.BBEEGConfiguration.()V at offset 44 at fr.fsh.bbeeg.common.config.BBEEGConfigurationTest.shouldAppVersionBeExtractedFromManifest(BBEEGConfigurationTest.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:51) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:63) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:75) at $Proxy3.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.remote.internal.MethodInvocationUnmarshallingDispatch.dispatch(MethodInvocationUnmarshallingDispatch.java:48) at org.gradle.messaging.dispatch.DiscardOnFailureDispatch.dispatch(DiscardOnFailureDispatch.java:31) at org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:129) at org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33) at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:69) at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Fr?d?ric Camblor Bordeaux JUG Board member Jenkins community member & plugin commiter From Alan.Bateman at oracle.com Mon Sep 12 05:52:43 2011 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 12 Sep 2011 13:52:43 +0100 Subject: Expecting a stackmap frame at branch target In-Reply-To: References: Message-ID: <4E6E009B.8050407@oracle.com> Fr?d?ric Camblor wrote: > Hi everyone ! > > I just migrated to openjdk 7 on my project and, just after the upgrade, most > of my unit test were in failure, throwing following exception : > > java.lang.VerifyError: Expecting a stackmap frame at branch target 81 > in method fr.fsh.bbeeg.common.config.BBEEGConfiguration.()V at > offset 44 > > > When I go back to jdk 6, every tests are back to green :-) > Use od -x to look at the class file to see which class version it is. Class files >= version 51 are verified (exclusively) by the type checking verifier whereas with version 50 then if the verification fails it falls back to the old type inferencing verifier. If you have something modifying the class files then maybe it isn't updating the stack map tables and that would explain the error. For your jdk6 test runs then try running with -XX:-FailOverToOldVerifier and see if fails too. -Alan. From fcamblor at gmail.com Mon Sep 12 08:22:03 2011 From: fcamblor at gmail.com (=?ISO-8859-1?Q?Fr=E9d=E9ric_Camblor?=) Date: Mon, 12 Sep 2011 17:22:03 +0200 Subject: Expecting a stackmap frame at branch target In-Reply-To: <4E6E009B.8050407@oracle.com> References: <4E6E009B.8050407@oracle.com> Message-ID: Hi Alan, Thanks for you reply, you helped me to point out problem was about cobertura instrumentation which looks not compatible with Java 7 I'll raise an issue on this topic on their issue tracker :) Fr?d?ric Camblor Bordeaux JUG Board member Jenkins community member & plugin commiter 2011/9/12 Alan Bateman > Fr?d?ric Camblor wrote: > >> Hi everyone ! >> >> I just migrated to openjdk 7 on my project and, just after the upgrade, >> most >> of my unit test were in failure, throwing following exception : >> >> java.lang.VerifyError: Expecting a stackmap frame at branch target 81 >> in method fr.fsh.bbeeg.common.config.**BBEEGConfiguration.()V at >> offset 44 >> >> >> When I go back to jdk 6, every tests are back to green :-) >> >> > Use od -x to look at the class file to see which class version it is. Class > files >= version 51 are verified (exclusively) by the type checking verifier > whereas with version 50 then if the verification fails it falls back to the > old type inferencing verifier. If you have something modifying the class > files then maybe it isn't updating the stack map tables and that would > explain the error. For your jdk6 test runs then try running with > -XX:-FailOverToOldVerifier and see if fails too. > > -Alan. > From fcamblor at gmail.com Tue Sep 13 13:57:54 2011 From: fcamblor at gmail.com (=?ISO-8859-1?Q?Fr=E9d=E9ric_Camblor?=) Date: Tue, 13 Sep 2011 22:57:54 +0200 Subject: Expecting a stackmap frame at branch target In-Reply-To: References: <4E6E009B.8050407@oracle.com> Message-ID: Alan, Woudn't there any -XX JVM parameter, on jdk7, allowing to get back jdk6 strategy about stack map tables ? Or maybe stack map tables _must_ be ok starting from jdk7 (due to class file specifications for example) ? Fr?d?ric Camblor Bordeaux JUG Board member Jenkins community member & plugin commiter 2011/9/12 Fr?d?ric Camblor > Hi Alan, > > Thanks for you reply, you helped me to point out problem was about > cobertura instrumentation which looks not compatible with Java 7 > > I'll raise an issue on this topic on their issue tracker :) > > Fr?d?ric Camblor > Bordeaux JUG Board member > Jenkins community member & plugin commiter > > > 2011/9/12 Alan Bateman > >> Fr?d?ric Camblor wrote: >> >>> Hi everyone ! >>> >>> I just migrated to openjdk 7 on my project and, just after the upgrade, >>> most >>> of my unit test were in failure, throwing following exception : >>> >>> java.lang.VerifyError: Expecting a stackmap frame at branch target 81 >>> in method fr.fsh.bbeeg.common.config.**BBEEGConfiguration.()V at >>> offset 44 >>> >>> >>> When I go back to jdk 6, every tests are back to green :-) >>> >>> >> Use od -x to look at the class file to see which class version it is. >> Class files >= version 51 are verified (exclusively) by the type checking >> verifier whereas with version 50 then if the verification fails it falls >> back to the old type inferencing verifier. If you have something modifying >> the class files then maybe it isn't updating the stack map tables and that >> would explain the error. For your jdk6 test runs then try running with >> -XX:-FailOverToOldVerifier and see if fails too. >> >> -Alan. >> > > From keith.mcguigan at oracle.com Tue Sep 13 14:12:12 2011 From: keith.mcguigan at oracle.com (Keith McGuigan) Date: Tue, 13 Sep 2011 17:12:12 -0400 Subject: Expecting a stackmap frame at branch target In-Reply-To: References: <4E6E009B.8050407@oracle.com> Message-ID: <87B2CA8A-ABE0-4D48-BDF4-ECAF9AAA2A06@oracle.com> The latter. New features in jdk7 require the use of the type-checking verifier -- which is what the cobertura instrumentation appears to be running afoul of. -- - Keith On Sep 13, 2011, at 4:57 PM, Fr?d?ric Camblor wrote: > Alan, > > Woudn't there any -XX JVM parameter, on jdk7, allowing to get back > jdk6 > strategy about stack map tables ? > Or maybe stack map tables _must_ be ok starting from jdk7 (due to > class file > specifications for example) ? > > Fr?d?ric Camblor > > Bordeaux JUG Board member > Jenkins community member & plugin commiter > > > 2011/9/12 Fr?d?ric Camblor > >> Hi Alan, >> >> Thanks for you reply, you helped me to point out problem was about >> cobertura instrumentation which looks not compatible with Java 7 >> >> I'll raise an issue on this topic on their issue tracker :) >> >> Fr?d?ric Camblor > > >> Bordeaux JUG Board member >> Jenkins community member & plugin commiter >> >> >> 2011/9/12 Alan Bateman >> >>> Fr?d?ric Camblor wrote: >>> >>>> Hi everyone ! >>>> >>>> I just migrated to openjdk 7 on my project and, just after the >>>> upgrade, >>>> most >>>> of my unit test were in failure, throwing following exception : >>>> >>>> java.lang.VerifyError: Expecting a stackmap frame at branch >>>> target 81 >>>> in method >>>> fr.fsh.bbeeg.common.config.**BBEEGConfiguration.()V at >>>> offset 44 >>>> >>>> >>>> When I go back to jdk 6, every tests are back to green :-) >>>> >>>> >>> Use od -x to look at the class file to see which class version it >>> is. >>> Class files >= version 51 are verified (exclusively) by the type >>> checking >>> verifier whereas with version 50 then if the verification fails it >>> falls >>> back to the old type inferencing verifier. If you have something >>> modifying >>> the class files then maybe it isn't updating the stack map tables >>> and that >>> would explain the error. For your jdk6 test runs then try running >>> with >>> -XX:-FailOverToOldVerifier and see if fails too. >>> >>> -Alan. >>> >> >>