[jboss-jira] [JBoss JIRA] (JASSIST-212) FieldAccess.replace causes java.lang.VerifyError

Jungkook Kim (JIRA) jira-events at lists.jboss.org
Tue Nov 12 00:44:05 EST 2013


    [ https://issues.jboss.org/browse/JASSIST-212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922585#comment-12922585 ] 

Jungkook Kim commented on JASSIST-212:
--------------------------------------

1. What happens if id is an Integer instead of Long?
>> the same result happens

2. Can you recreate on a recent Java 8 JDK and attach the full VerifyError exception output. The VerifyError Exception is more verbose in Java 8.
>> here it is. I changed the class name : ErrorCase -> JIRA212.
java.lang.VerifyError: Stack map does not match the one at exception handler 52
Exception Details:
  Location:
    test4/JIRA212.test()V @52: astore_2
  Reason:
    Type 'java/lang/Integer' (current frame, locals[4]) is not assignable to 'java/lang/String' (stack map, locals[4])
  Current Frame:
    bci: @26
    flags: { }
    locals: { 'test4/JIRA212', 'test4/JIRA212$TestObject', top, 'test4/JIRA212$TestObject', 'java/lang/Integer' }
    stack: { 'java/lang/Throwable' }
  Stackmap Frame:
    bci: @52
    flags: { }
    locals: { 'test4/JIRA212', 'test4/JIRA212$TestObject', top, 'test4/JIRA212$TestObject', 'java/lang/String' }
    stack: { 'java/lang/Throwable' }
  Bytecode:
    0000000: bb00 0259 b700 034c 2b12 043a 044e 2d19
    0000010: 04b6 0035 2b10 64b8 0006 3a04 4e2d 1904
    0000020: b600 392b 4e01 3a04 2db6 003d 3a04 1904
    0000030: 4da7 0008 4d2c b600 09b1
  Exception Handler Table:
    bci [20, 49] => handler: 52
  Stackmap Table:
    full_frame(@52,{Object[#29],Object[#30],Top,Object[#30],Object[#63]},{Object[#31]})
    full_frame(@57,{Object[#29],Object[#30],Object[#11],Object[#30],Object[#63]},{})

        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2642)
        at java.lang.Class.getConstructor0(Class.java:2942)
        at java.lang.Class.newInstance(Class.java:403)
        at javassist.JvstTestRoot.make(JvstTestRoot.java:37)
        at javassist.JvstTest4.testJIRA212(JvstTest4.java:941)
        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:483)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        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:483)
        at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:95)
        at org.apache.maven.surefire.junit.JUnit3Provider.executeTestSet(JUnit3Provider.java:121)
        at org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:98)
        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:483)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)


3. Have you tried to recreate this problem in the Javassist testsuite? The source is available from https://github.com/jboss-javassist/javassist and your steps (to recreate) should be possible in the testsuite as well.
>> I added a test case for this isssue. The same problem occured in the javassist testsuite.
>> https://github.com/kjkmadness/javassist/commits/JIRA212
>> see this commit https://github.com/kjkmadness/javassist/commit/b6be553e1d12e788e6a36cb36d0f73284b5a0021
>> do you want me to send a pull-request?
                
> FieldAccess.replace causes java.lang.VerifyError
> ------------------------------------------------
>
>                 Key: JASSIST-212
>                 URL: https://issues.jboss.org/browse/JASSIST-212
>             Project: Javassist
>          Issue Type: Bug
>    Affects Versions: 3.17.0-GA, 3.17.1-GA, 3.18.0-GA, 3.18.1-GA
>         Environment: JAVA7
>            Reporter: Jungkook Kim
>            Assignee: Shigeru Chiba
>
> FieldAccess.replace causes java.lang.VerifyError with a specific code structure.
> javassist version 3.17.0~3.18.1
> 3.16.1 works fine.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list