Menu

#721 VerifyError: Preverification breaks Groovy 2.5 code

v6.0
open
nobody
High
2018-09-14
2018-09-14
No

Test.groovy

class Test
{
  static class TestException extends Exception 
  {
    TestException() 
    {
      super()
    }

    TestException(String message) 
    {
      super(message)
    }
  }

  static void main(String[] args)
  {
    throw new TestException()
  }
}

config.pro

-dontshrink
-dontoptimize
-dontobfuscate
-injar test.jar
-outjar test-obfuscated.jar
-libraryjar groovy-2.5.2.jar 
-libraryjar C:\jdk1.8.0_102\jre\lib\rt.jar

Program output:

Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 197
Exception Details:
  Location:
    Test$TestException.<init>(Ljava/lang/String;)V @197: new
  Reason:
    Type uninitializedThis (current frame, stack[1]) is not assignable to 'Test$TestException' (stack map, stack[1])
  Current Frame:
    bci: @22
    flags: { flagThisUninit }
    locals: { uninitializedThis, 'java/lang/String', '[Lorg/codehaus/groovy/runtime/callsite/CallSite;' }
    stack: { '[Ljava/lang/Object;', uninitializedThis, integer }
  Stackmap Frame:
    bci: @197
    flags: { }
    locals: { }
    stack: { '[Ljava/lang/Object;', 'Test$TestException' }
  Bytecode:
    0x0000000: b800 1b4d 04bd 000c 5903 2b53 5910 ff12
    0x0000010: 0ab8 002f 2a5f ab00 0000 00af 0000 0005
    0x0000020: 8794 83a0 0000 0032 aad3 b1ff 0000 0047
    0x0000030: c783 a456 0000 005a f0c1 c756 0000 0087
    0x0000040: 0000 9b75 0000 00a6 5f5a 5903 3212 0eb8
    0x0000050: 002a c000 0e5f 57b7 0022 a700 755f 5a59
    0x0000060: 0332 b800 33c0 000d 5f57 b700 1fa7 0062
    0x0000070: 5f5a 5903 32b8 0033 c000 0d5f 5904 3212
    0x0000080: 0eb8 002a c000 0e5f 5905 32b8 0032 5f59
    0x0000090: 0632 b800 325f 57b7 0021 a700 355f 5a59
    0x00000a0: 0332 b800 33c0 000d 5f59 0432 120e b800
    0x00000b0: 2ac0 000e 5f57 b700 20a7 0016 5f5a 57b7
    0x00000c0: 001e a700 0dbb 000b 5912 03b7 0023 bf57
    0x00000d0: 2ab6 001c 4e2d 2a5f b500 182d 57b1     
  Stackmap Table:
    full_frame(@72,{UninitializedThis},{Object[#6],UninitializedThis})
    full_frame(@93,{UninitializedThis},{Object[#6],UninitializedThis})
    full_frame(@112,{UninitializedThis},{Object[#6],UninitializedThis})
    full_frame(@157,{UninitializedThis},{Object[#6],UninitializedThis})
    full_frame(@188,{UninitializedThis},{Object[#6],UninitializedThis})
    full_frame(@197,{},{Object[#6],Object[#5]})
    full_frame(@207,{Object[#5]},{Object[#6]})

    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getDeclaredConstructors(Unknown Source)
    at org.codehaus.groovy.reflection.CachedClass$2$1.run(CachedClass.java:88)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.codehaus.groovy.reflection.CachedClass$2.initValue(CachedClass.java:86)
    at org.codehaus.groovy.reflection.CachedClass$2.initValue(CachedClass.java:81)
    at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:50)
    at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:37)
    at org.codehaus.groovy.reflection.CachedClass.getConstructors(CachedClass.java:310)
    at groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:218)
    at groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:228)
    at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createNormalMetaClass(MetaClassRegistry.java:171)
    at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createWithCustomLookup(MetaClassRegistry.java:161)
    at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.create(MetaClassRegistry.java:144)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:288)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:331)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:270)
    at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:976)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(CallSiteArray.java:86)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:242)
    at Test.main(Test.groovy:18)
1 Attachments

Related

Bugs: #5
Bugs: #6

Discussion


Log in to post a comment.

MongoDB Logo MongoDB