Uploaded image for project: 'Javassist'
  1. Javassist
  2. JASSIST-160

Java.lang.VerifyErrors occur in specific cases when using javaassist with Java 1.7

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.16.1-GA
    • Fix Version/s: 3.17.0-GA
    • Labels:
      None
    • Environment:
      jdk1.7.0_03 on Windows XP SP 3
    • Steps to Reproduce:
      Hide

      I'm attaching to this bug a self contained example where you can see both type of errors.
      The example includes all source files needed and scripts to build and run.
      You will need both Java 1.6 and Java 1.7 installed on your machine to run the full test and see the difference.

      To run the test:

      1. Extract the attached jatest.zip file to your machine.
      2. Edit the files test1.6.bat and test1.7.bat and adjust the paths to your Java 1.6 and 1.7 installations respectively.
      If you are running on a non-windows platform you can easily translate these scripts to the target platform.
      3. Run both test1.6.bat and test1.7.bat. These two scripts build and run the same test with Java 1.6 and Java 1.7 respectively.
      4. Each x script (x= 1.6, 1.7) does the following:
      Compiles the source files.
      Creates a testx.jar file.
      Runs the class TraceJar against the testx.jar.
      TraceJar uses javaassist to insert simple print statements into each method using insertBefore and insertAfter. It creates a new testxT.jar
      Runs the Main test class against the generated testxT.jar.
      The test tries to load the two test classes Test1 and Test2 and then also tries to run through some of their methods.

      You can see that all this works fine with Java 1.6 but fails with Java 1.7.
      See below the output with Java 1.6 vs. the output with Java 1.7.

      Note that getting the second type of error - Bad return type - is quite easy. All it takes is a simple method like the one in Test2.
      The first type of error - Inconsistent stackmap frames - seems to occur only for a very specific code pattern as in Test1. Changing that code even slightly results in either a valid class or in the Bad return type error.

      Output with Java 1.6:

      ...
      Running test with jar16T.jar
      before method Main.main(java.lang.String[]), params=[[Ljava.lang.String;@1f33675]
      before method Main.loadClass(java.lang.String), params=[Test1]
      loading test class Test1
      class was loaded succesfuly
      after method Main.loadClass(java.lang.String), retval=null
      before method Main.loadClass(java.lang.String), params=[Test2]
      loading test class Test2
      class was loaded succesfuly
      after method Main.loadClass(java.lang.String), retval=null
      before method Main.runTest1()
      before method Test1.f(Info), params=[Info@19ee1ac]
      before method Test1.createHolder()
      after method Test1.createHolder()
      before method Info.createChild(Holder), params=[Holder@1befab0]
      after method Info.createChild(Holder)
      before method Child.init()
      after method Child.init(), retval=null
      after method Test1.f(Info)
      before method Test1.f(Info), params=[SubInfo@13c5982]
      before method Test1.createHolder()
      after method Test1.createHolder()
      before method SubInfo.createChild(Holder), params=[Holder@1186fab]
      after method SubInfo.createChild(Holder)
      before method Child.init()
      after method Child.init(), retval=null
      after method Test1.f(Info)
      after method Main.runTest1(), retval=null
      before method Main.runTest2()
      before method Test2.f()
      after method Test2.f()
      after method Main.runTest2(), retval=null
      after method Main.main(java.lang.String[]), retval=null

      Output with Java 1.7:

      ...
      Running test with jar17T.jar
      before method Main.main(java.lang.String[]), params=[[Ljava.lang.String;@1489c06]
      before method Main.loadClass(java.lang.String), params=[Test1]
      loading test class Test1
      failed to load class
      java.lang.VerifyError: Inconsistent stackmap frames at branch target 68 in method Test1.f(LInfo;)LParent; at offset 61
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:186)
      at Main.loadClass(Main.java:16)
      at Main.main(Main.java:7)
      after method Main.loadClass(java.lang.String), retval=null
      before method Main.loadClass(java.lang.String), params=[Test2]
      loading test class Test2
      failed to load class
      java.lang.VerifyError: Bad return type in method Test2.f()LParent; at offset 22
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:186)
      at Main.loadClass(Main.java:16)
      at Main.main(Main.java:8)
      after method Main.loadClass(java.lang.String), retval=null
      before method Main.runTest1()
      failed to run test1
      java.lang.VerifyError: Inconsistent stackmap frames at branch target 68 in method Test1.f(LInfo;)LParent; at offset 61
      at Main.runTest1(Main.java:27)
      at Main.main(Main.java:9)
      after method Main.runTest1(), retval=null
      before method Main.runTest2()
      failed to run test2
      java.lang.VerifyError: Bad return type in method Test2.f()LParent; at offset 22
      at Main.runTest2(Main.java:38)
      at Main.main(Main.java:10)
      after method Main.runTest2(), retval=null
      after method Main.main(java.lang.String[]), retval=null

      Show
      I'm attaching to this bug a self contained example where you can see both type of errors. The example includes all source files needed and scripts to build and run. You will need both Java 1.6 and Java 1.7 installed on your machine to run the full test and see the difference. To run the test: 1. Extract the attached jatest.zip file to your machine. 2. Edit the files test1.6.bat and test1.7.bat and adjust the paths to your Java 1.6 and 1.7 installations respectively. If you are running on a non-windows platform you can easily translate these scripts to the target platform. 3. Run both test1.6.bat and test1.7.bat. These two scripts build and run the same test with Java 1.6 and Java 1.7 respectively. 4. Each x script (x= 1.6, 1.7) does the following: Compiles the source files. Creates a testx.jar file. Runs the class TraceJar against the testx.jar. TraceJar uses javaassist to insert simple print statements into each method using insertBefore and insertAfter. It creates a new testxT.jar Runs the Main test class against the generated testxT.jar. The test tries to load the two test classes Test1 and Test2 and then also tries to run through some of their methods. You can see that all this works fine with Java 1.6 but fails with Java 1.7. See below the output with Java 1.6 vs. the output with Java 1.7. Note that getting the second type of error - Bad return type - is quite easy. All it takes is a simple method like the one in Test2. The first type of error - Inconsistent stackmap frames - seems to occur only for a very specific code pattern as in Test1. Changing that code even slightly results in either a valid class or in the Bad return type error. Output with Java 1.6: ... Running test with jar16T.jar before method Main.main(java.lang.String[]), params=[ [Ljava.lang.String;@1f33675] before method Main.loadClass(java.lang.String), params= [Test1] loading test class Test1 class was loaded succesfuly after method Main.loadClass(java.lang.String), retval=null before method Main.loadClass(java.lang.String), params= [Test2] loading test class Test2 class was loaded succesfuly after method Main.loadClass(java.lang.String), retval=null before method Main.runTest1() before method Test1.f(Info), params= [Info@19ee1ac] before method Test1.createHolder() after method Test1.createHolder() before method Info.createChild(Holder), params= [Holder@1befab0] after method Info.createChild(Holder) before method Child.init() after method Child.init(), retval=null after method Test1.f(Info) before method Test1.f(Info), params= [SubInfo@13c5982] before method Test1.createHolder() after method Test1.createHolder() before method SubInfo.createChild(Holder), params= [Holder@1186fab] after method SubInfo.createChild(Holder) before method Child.init() after method Child.init(), retval=null after method Test1.f(Info) after method Main.runTest1(), retval=null before method Main.runTest2() before method Test2.f() after method Test2.f() after method Main.runTest2(), retval=null after method Main.main(java.lang.String[]), retval=null Output with Java 1.7: ... Running test with jar17T.jar before method Main.main(java.lang.String[]), params=[ [Ljava.lang.String;@1489c06] before method Main.loadClass(java.lang.String), params= [Test1] loading test class Test1 failed to load class java.lang.VerifyError: Inconsistent stackmap frames at branch target 68 in method Test1.f(LInfo;)LParent; at offset 61 at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at Main.loadClass(Main.java:16) at Main.main(Main.java:7) after method Main.loadClass(java.lang.String), retval=null before method Main.loadClass(java.lang.String), params= [Test2] loading test class Test2 failed to load class java.lang.VerifyError: Bad return type in method Test2.f()LParent; at offset 22 at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at Main.loadClass(Main.java:16) at Main.main(Main.java:8) after method Main.loadClass(java.lang.String), retval=null before method Main.runTest1() failed to run test1 java.lang.VerifyError: Inconsistent stackmap frames at branch target 68 in method Test1.f(LInfo;)LParent; at offset 61 at Main.runTest1(Main.java:27) at Main.main(Main.java:9) after method Main.runTest1(), retval=null before method Main.runTest2() failed to run test2 java.lang.VerifyError: Bad return type in method Test2.f()LParent; at offset 22 at Main.runTest2(Main.java:38) at Main.main(Main.java:10) after method Main.runTest2(), retval=null after method Main.main(java.lang.String[]), retval=null
    • Similar Issues:
      Show 10 results 

      Description

      We found at least two different cases where inserting bytecode using javaassist results in a class that cannot be loaded with Java 1.7.

      java.lang.VerifyError: Inconsistent stackmap frames at branch target
      java.lang.VerifyError: Bad return type in method

      The exact same code injection on the exact same classes works fine with Java 1.6.
      We upgraded to the latest version of javaassist - 3.16.1.GA, but it didn't solve the problem.

      I'm attaching to this bug a self contained example where you can see both type of errors.
      More details in "Steps to Reproduce".

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            avners Avner Singerman added a comment -

            Test case for this bug.

            Show
            avners Avner Singerman added a comment - Test case for this bug.
            Hide
            famod Falko M. added a comment -

            This seems to cause problems for many powermock-users (including me), see:
            http://code.google.com/p/powermock/issues/detail?id=355#c42

            Show
            famod Falko M. added a comment - This seems to cause problems for many powermock-users (including me), see: http://code.google.com/p/powermock/issues/detail?id=355#c42
            Hide
            tylerdca Tyler Brown added a comment -

            From the PowerMock issue thread. Anyone trying to temporarily workaround this issue, adding the following argument -XX:-UseSplitVerifier does prevent this from occurring.

            Show
            tylerdca Tyler Brown added a comment - From the PowerMock issue thread. Anyone trying to temporarily workaround this issue, adding the following argument -XX:-UseSplitVerifier does prevent this from occurring.
            Hide
            chiba Shigeru Chiba added a comment -

            To fix various errors related to stackmap tables, I have rewritten the whole javassist.bytecode.stackmap package. Now Javassist generates a write stack map table as far as I tested.

            Show
            chiba Shigeru Chiba added a comment - To fix various errors related to stackmap tables, I have rewritten the whole javassist.bytecode.stackmap package. Now Javassist generates a write stack map table as far as I tested.
            Hide
            muppet_tizer D K added a comment - - edited

            Does not seem to fix the PowerMock issue:
            http://code.google.com/p/powermock/issues/detail?id=355

            Show
            muppet_tizer D K added a comment - - edited Does not seem to fix the PowerMock issue: http://code.google.com/p/powermock/issues/detail?id=355
            Hide
            chiba Shigeru Chiba added a comment -

            Really? I will check this.

            Show
            chiba Shigeru Chiba added a comment - Really? I will check this.
            Hide
            chiba Shigeru Chiba added a comment -

            I have committed a revised version, which should have fixed the PowerMock issue.

            Show
            chiba Shigeru Chiba added a comment - I have committed a revised version, which should have fixed the PowerMock issue.
            Hide
            muppet_tizer D K added a comment -

            Yes PowerMock issue is fixed now. Thanks for the quick turnaround.

            Any release date for javassist-3.17.0-GA?

            Show
            muppet_tizer D K added a comment - Yes PowerMock issue is fixed now. Thanks for the quick turnaround. Any release date for javassist-3.17.0-GA?
            Hide
            chiba Shigeru Chiba added a comment -

            3.17.0-GA will be released in a week.

            Show
            chiba Shigeru Chiba added a comment - 3.17.0-GA will be released in a week.
            Hide
            hardie82 Thomas H added a comment -

            Hi. I think the issue still exists if powermock is used for testing classes extending the SwingWorker. See the powermock issue and the modified example: http://code.google.com/p/powermock/issues/detail?id=355#c61. Maybe if the problem occurs in javassist, you can fix this for the next version.

            Show
            hardie82 Thomas H added a comment - Hi. I think the issue still exists if powermock is used for testing classes extending the SwingWorker. See the powermock issue and the modified example: http://code.google.com/p/powermock/issues/detail?id=355#c61 . Maybe if the problem occurs in javassist, you can fix this for the next version.
            Hide
            chiba Shigeru Chiba added a comment -

            OK, I will check this.

            Show
            chiba Shigeru Chiba added a comment - OK, I will check this.
            Hide
            chiba Shigeru Chiba added a comment -

            Yes, it was a bug. So I have fixed.

            Show
            chiba Shigeru Chiba added a comment - Yes, it was a bug. So I have fixed.
            Hide
            hardie82 Thomas H added a comment -

            I have verified the bugfix to the powermock sample and it works fine. Now the new version could be released and add to the maven repository, so that the powermock project can modify the dependency to this version and release a new version themself. Thanks for the quick bugfix.

            Show
            hardie82 Thomas H added a comment - I have verified the bugfix to the powermock sample and it works fine. Now the new version could be released and add to the maven repository, so that the powermock project can modify the dependency to this version and release a new version themself. Thanks for the quick bugfix.
            Hide
            OliverHrdz Oliver Hernandez added a comment -

            I'd like to add another error message that seems to be the result of this same bug:

            java.lang.VerifyError: Bad type on operand stack in aaload in method org.foo.bar.FooBar.<init>()V at offset 101

            My use case is also with PowerMock, and the unit test involves mocking construction of a new object using PowerMockito.whenNew(). Researching this problem led me here, and applying the latest javassist-3.17.0-GA.jar resolved this error in my test.

            Show
            OliverHrdz Oliver Hernandez added a comment - I'd like to add another error message that seems to be the result of this same bug: java.lang.VerifyError: Bad type on operand stack in aaload in method org.foo.bar.FooBar.<init>()V at offset 101 My use case is also with PowerMock, and the unit test involves mocking construction of a new object using PowerMockito.whenNew(). Researching this problem led me here, and applying the latest javassist-3.17.0-GA.jar resolved this error in my test.
            Hide
            jbainbridge John Bainbridge added a comment -

            I just pull trunk and i noticed that this fixed most of the promblems however not all. Here are my stack traces:

            Exception in thread "main" java.lang.IllegalStateException: Failed to transform class with name xxx.xxxxx.xxxxx.xxxxxx. Reason: null
            at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:207)
            at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:145)
            at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:264)
            at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
            at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
            at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
            at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:390)
            at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:371)
            at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673)
            at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480)
            at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306)
            at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241)
            at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)
            at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
            at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089)
            at java.lang.Class.getAnnotations(Class.java:3069)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.classAnnotations(PowerMockJUnit44RunnerDelegateImpl.java:165)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.getDescription(PowerMockJUnit44RunnerDelegateImpl.java:157)
            at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.getDescription(JUnit4TestSuiteChunkerImpl.java:172)
            at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.getDescription(AbstractCommonPowerMockRunner.java:47)
            at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:40)
            at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
            at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:520)
            at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
            at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:884)
            Caused by: java.lang.NullPointerException
            at javassist.bytecode.stackmap.TypeData.commonSuperClassEx(TypeData.java:400)
            at javassist.bytecode.stackmap.TypeData$TypeVar.fixTypes2(TypeData.java:342)
            at javassist.bytecode.stackmap.TypeData$TypeVar.fixTypes(TypeData.java:325)
            at javassist.bytecode.stackmap.TypeData$TypeVar.dfs(TypeData.java:270)
            at javassist.bytecode.stackmap.MapMaker.fixTypes(MapMaker.java:287)
            at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:140)
            at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:99)
            at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
            at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
            at javassist.expr.ExprEditor.doit(ExprEditor.java:113)
            at javassist.CtClassType.instrument(CtClassType.java:1398)
            at org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:75)
            at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:203)
            ... 27 more
            and :

            java.lang.VerifyError: Stack map does not match the one at exception handler 2290 in method xxx.xxxxx.xxx.xxxxxxx.xxxxxxxx()Ljava/lang/String; at offset 686
            at java.lang.Class.getDeclaredMethods0(Native Method)
            at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
            at java.lang.Class.getMethod0(Class.java:2685)
            at java.lang.Class.getMethod(Class.java:1620)
            at org.easymock.internal.ObjectMethodsFilter.<init>(ObjectMethodsFilter.java:55)
            at org.easymock.internal.MocksControl.createMock(MocksControl.java:59)
            at org.powermock.api.easymock.PowerMock.doCreateMock(PowerMock.java:2212)
            at org.powermock.api.easymock.PowerMock.doMock(PowerMock.java:2163)
            at org.powermock.api.easymock.PowerMock.createMock(PowerMock.java:89)
            at xxx.xxxx.xxx.xxxx.xxxxxxxxxxxxxxTest.testxxxxxxxxxx(xxxxxxxxxxxxxxTest.java:93)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:312)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:296)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTestInSuper(PowerMockJUnit47RunnerDelegateImpl.java:112)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTest(PowerMockJUnit47RunnerDelegateImpl.java:73)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:284)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:209)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:148)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:122)
            at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
            at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:102)
            at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
            at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:42)

            Show
            jbainbridge John Bainbridge added a comment - I just pull trunk and i noticed that this fixed most of the promblems however not all. Here are my stack traces: Exception in thread "main" java.lang.IllegalStateException: Failed to transform class with name xxx.xxxxx.xxxxx.xxxxxx. Reason: null at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:207) at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:145) at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:390) at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:371) at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089) at java.lang.Class.getAnnotations(Class.java:3069) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.classAnnotations(PowerMockJUnit44RunnerDelegateImpl.java:165) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.getDescription(PowerMockJUnit44RunnerDelegateImpl.java:157) at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.getDescription(JUnit4TestSuiteChunkerImpl.java:172) at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.getDescription(AbstractCommonPowerMockRunner.java:47) at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:40) at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:520) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:884) Caused by: java.lang.NullPointerException at javassist.bytecode.stackmap.TypeData.commonSuperClassEx(TypeData.java:400) at javassist.bytecode.stackmap.TypeData$TypeVar.fixTypes2(TypeData.java:342) at javassist.bytecode.stackmap.TypeData$TypeVar.fixTypes(TypeData.java:325) at javassist.bytecode.stackmap.TypeData$TypeVar.dfs(TypeData.java:270) at javassist.bytecode.stackmap.MapMaker.fixTypes(MapMaker.java:287) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:140) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:99) at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423) at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405) at javassist.expr.ExprEditor.doit(ExprEditor.java:113) at javassist.CtClassType.instrument(CtClassType.java:1398) at org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:75) at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:203) ... 27 more and : java.lang.VerifyError: Stack map does not match the one at exception handler 2290 in method xxx.xxxxx.xxx.xxxxxxx.xxxxxxxx()Ljava/lang/String; at offset 686 at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) at java.lang.Class.getMethod0(Class.java:2685) at java.lang.Class.getMethod(Class.java:1620) at org.easymock.internal.ObjectMethodsFilter.<init>(ObjectMethodsFilter.java:55) at org.easymock.internal.MocksControl.createMock(MocksControl.java:59) at org.powermock.api.easymock.PowerMock.doCreateMock(PowerMock.java:2212) at org.powermock.api.easymock.PowerMock.doMock(PowerMock.java:2163) at org.powermock.api.easymock.PowerMock.createMock(PowerMock.java:89) at xxx.xxxx.xxx.xxxx.xxxxxxxxxxxxxxTest.testxxxxxxxxxx(xxxxxxxxxxxxxxTest.java:93) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:312) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:296) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTestInSuper(PowerMockJUnit47RunnerDelegateImpl.java:112) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTest(PowerMockJUnit47RunnerDelegateImpl.java:73) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:284) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:209) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:148) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:122) at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:120) at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:102) at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53) at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:42)
            Hide
            chiba Shigeru Chiba added a comment -

            any concrete test case?

            Show
            chiba Shigeru Chiba added a comment - any concrete test case?
            Hide
            jbainbridge John Bainbridge added a comment -

            When I'm trying to mock final class as well as a Serializable implenatation. I'll try to come up with some dummy test cases for you.

            Show
            jbainbridge John Bainbridge added a comment - When I'm trying to mock final class as well as a Serializable implenatation. I'll try to come up with some dummy test cases for you.
            Hide
            chiba Shigeru Chiba added a comment -

            thanks.

            Show
            chiba Shigeru Chiba added a comment - thanks.
            Hide
            jamiol Jacob m added a comment -

            Any chance that Johns issue could be opened as a new bug? I would really love to see a public release of 3.17.0-GA as it fixes a lot of problems for people using PowerMock with Java 1.7.
            This issue would remain open as long as any verify errors turns up, no matter the nature of it. I suggest one issue for each verify error type to make it easier to get stuff released...

            Thank you for fixing the issues - great work!

            Show
            jamiol Jacob m added a comment - Any chance that Johns issue could be opened as a new bug? I would really love to see a public release of 3.17.0-GA as it fixes a lot of problems for people using PowerMock with Java 1.7. This issue would remain open as long as any verify errors turns up, no matter the nature of it. I suggest one issue for each verify error type to make it easier to get stuff released... Thank you for fixing the issues - great work!
            Hide
            lisahenderson Lisa Henderson added a comment -

            I agree with Jacom M - it would be extremely valuable to release 3.17.0-GA to publish the issue solution to date. Is there a release date being considered?

            Show
            lisahenderson Lisa Henderson added a comment - I agree with Jacom M - it would be extremely valuable to release 3.17.0-GA to publish the issue solution to date. Is there a release date being considered?
            Hide
            chiba Shigeru Chiba added a comment -

            OK, I will check other issues and release GA as soon as possible.

            Show
            chiba Shigeru Chiba added a comment - OK, I will check other issues and release GA as soon as possible.
            Hide
            chiba Shigeru Chiba added a comment -

            The bug reported by John Bainbridge has not been fixed yet.
            John, if you make a test case, can you file it as a separate issue?

            Show
            chiba Shigeru Chiba added a comment - The bug reported by John Bainbridge has not been fixed yet. John, if you make a test case, can you file it as a separate issue?
            Hide
            jbainbridge John Bainbridge added a comment -

            Yeah. I'm working on trying to come up with valid test case.

            Show
            jbainbridge John Bainbridge added a comment - Yeah. I'm working on trying to come up with valid test case.
            Hide
            chiba Shigeru Chiba added a comment -

            A StackMapTable-related bug in Hibernate has been discussed in Jassist-163. A patch to Hibernate has been submitted.

            Show
            chiba Shigeru Chiba added a comment - A StackMapTable-related bug in Hibernate has been discussed in Jassist-163. A patch to Hibernate has been submitted.
            Hide
            amitabakoptier ami tabak added a comment -

            Hon. Professor Chiba
            Can you estimate when the 3.17 GA will be released.
            Sincerely
            Ami Tabak

            Show
            amitabakoptier ami tabak added a comment - Hon. Professor Chiba Can you estimate when the 3.17 GA will be released. Sincerely Ami Tabak
            Hide
            chiba Shigeru Chiba added a comment -

            Although I'm still waiting for final checks, I hope it will be released within this week.

            Show
            chiba Shigeru Chiba added a comment - Although I'm still waiting for final checks, I hope it will be released within this week.
            Hide
            chiba Shigeru Chiba added a comment -

            I have released 3.17.0-GA. It will be available from:

            www.javassist.org

            It will be also available from maven and sonotype.

            Show
            chiba Shigeru Chiba added a comment - I have released 3.17.0-GA. It will be available from: www.javassist.org It will be also available from maven and sonotype.
            Hide
            jamiol Jacob m added a comment -

            This is great news! Thank you.
            Do you know when it will be available through maven?

            Show
            jamiol Jacob m added a comment - This is great news! Thank you. Do you know when it will be available through maven?
            Hide
            chiba Shigeru Chiba added a comment -

            It will be today or on Monday.

            Show
            chiba Shigeru Chiba added a comment - It will be today or on Monday.
            Show
            roger.glover Roger Glover added a comment - Hmmm. Not up yet on Monday, unless I'm looking in the wrong places: http://mvnrepository.com/artifact/org.javassist/javassist http://mirrors.ibiblio.org/maven2/org/javassist/javassist/ http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.javassist%22%20AND%20a%3A%22javassist%22

              People

              • Assignee:
                chiba Shigeru Chiba
                Reporter:
                avners Avner Singerman
              • Votes:
                11 Vote for this issue
                Watchers:
                22 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development