Menu

#562 Bad invokespecial instruction: current class isn't assignable to reference class.

v5.1
open
VerifyError (3)
1
2019-07-18
2015-01-27
No

Last working version is 4.9 for me. For all other versions thereafter the following VerifyError will be thrown.

2015-01-27T22:12:37: SCHWERWIEGEND: it.schulte.beans.UncaughtExceptionHandler: Bad invokespecial instruction: current class isn't assignable to reference class.
Exception Details:
  Location:
    it/schulte/beans/sdi/actions/CreateFileAction.g()V @122: invokespecial
  Reason:
    Error exists in the bytecode
  Bytecode:
    0000000: 2ab6 004e c600 aa2a b400 402a b600 4fb6
    0000010: 0076 9a00 9c2a b700 51b6 0056 03bd 002e
    0000020: b800 6799 0017 2a59 4cb4 003b 2ab6 004d
    0000030: 2ab7 0051 b600 4399 0077 2ab6 004e c000
    0000040: 212a b700 514d 4c2c b600 56b8 0066 572b
    0000050: b400 3c59 4ec2 2bb4 003d 3a04 2b01 b500
    0000060: 3d2b 01b5 003e 2b12 1b19 0401 b600 472d
    0000070: c3a7 0008 4d2d c32c bf2b b700 48bb 0022
    0000080: 592b 2c01 b700 49b9 007a 0200 57a7 0016
    0000090: 4ebb 001d 592b b400 3f59 4db4 003a 2db7
    00000a0: 0042 bf2a b400 402a b700 51b6 0075 b1  
  Exception Handler Table:
    bci [86, 113] => handler: 116
    bci [116, 119] => handler: 116
    bci [71, 141] => handler: 144
  Stackmap Table:
    same_frame(@58)
    full_frame(@116,{Top,Object[#33],Top,Object[#41]},{Object[#44]})
    full_frame(@121,{Object[#35],Object[#33],Object[#36]},{})
    full_frame(@144,{Top,Object[#33]},{Object[#37]})
    full_frame(@163,{Object[#35]},{})
    chop_frame(@174,1)

java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.
Exception Details:
  Location:
    it/schulte/beans/sdi/actions/CreateFileAction.g()V @122: invokespecial
  Reason:
    Error exists in the bytecode
  Bytecode:
    0000000: 2ab6 004e c600 aa2a b400 402a b600 4fb6
    0000010: 0076 9a00 9c2a b700 51b6 0056 03bd 002e
    0000020: b800 6799 0017 2a59 4cb4 003b 2ab6 004d
    0000030: 2ab7 0051 b600 4399 0077 2ab6 004e c000
    0000040: 212a b700 514d 4c2c b600 56b8 0066 572b
    0000050: b400 3c59 4ec2 2bb4 003d 3a04 2b01 b500
    0000060: 3d2b 01b5 003e 2b12 1b19 0401 b600 472d
    0000070: c3a7 0008 4d2d c32c bf2b b700 48bb 0022
    0000080: 592b 2c01 b700 49b9 007a 0200 57a7 0016
    0000090: 4ebb 001d 592b b400 3f59 4db4 003a 2db7
    00000a0: 0042 bf2a b400 402a b700 51b6 0075 b1  
  Exception Handler Table:
    bci [86, 113] => handler: 116
    bci [116, 119] => handler: 116
    bci [71, 141] => handler: 144
  Stackmap Table:
    same_frame(@58)
    full_frame(@116,{Top,Object[#33],Top,Object[#41]},{Object[#44]})
    full_frame(@121,{Object[#35],Object[#33],Object[#36]},{})
    full_frame(@144,{Top,Object[#33]},{Object[#37]})
    full_frame(@163,{Object[#35]},{})
    chop_frame(@174,1)

        at it.schulte.beans.sdi.SingleDocumentApplicationFrame.<init>(Unknown Source)
        at it.schulte.passwords.PasswortverwaltungFrame.<init>(Unknown Source)
        at bU.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
        at java.awt.EventQueue.access$200(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:694)
        at java.awt.EventQueue$3.run(EventQueue.java:692)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Configuration is:

-verbose
-forceprocessing
-injars ${project.build.directory}${file.separator}${project.build.finalName}.${project.packaging}
-outjars ${project.build.directory}${file.separator}${project.build.finalName}-proguard.${project.packaging}
-libraryjars ${java.home}${file.separator}lib${file.separator}rt.jar${path.separator}${java.home}${file.separator}lib${file.separator}jce.jar${path.separator}${proguard.libraryjars}
-printmapping ${project.build.directory}${file.separator}proguard.map
-allowaccessmodification
-optimizations !code/removal/advanced,!field/removal/writeonly,!method/marking/static,!method/removal/parameter,!code/removal/simple,!code/simplification/branch,!code/removal/exception
-optimizationpasses 1000
-repackageclasses
-keepattributes Exceptions,Signature,*Annotation*
-keep class it.schulte.beans.model.package-info
-keep class it.schulte.passwords.model.package-info

-keep public class * {
}

-keep public enum * {
}

-keep public interface * {
}

-keepclassmembers public class * {
  *** getObject();
  *** valueOf(***);
  *** getJavaValue(java.lang.ClassLoader);
  public static void main(java.lang.String[]);
}

-keepclassmembers,allowoptimization enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keepclassmembers enum it.schulte.beans.model.** {
  public protected *;
}

-keepclassmembers class it.schulte.beans.model.** {
  public protected *;
}

-keepclassmembers enum it.schulte.passwords.model.** {
  public protected *;
}

-keepclassmembers class it.schulte.passwords.model.** {
  public protected *;
}

-assumenosideeffects class java.lang.System {
    public static long currentTimeMillis();
}

-assumenosideeffects interface org.jomc.ObjectManager {
    *;
}

-assumenosideeffects class org.jomc.ObjectManagerFactory {
    *;
}

-assumenosideeffects class org.jomc.ObjectManagementException {
    *;
}

Searching that error message yields

https://bugs.openjdk.java.net/browse/JDK-8009697

which maybe explains what is wrong about that class file.

Related

Bugs: #33
Bugs: #35
Bugs: #36
Bugs: #37
Bugs: #41
Bugs: #44

Discussion

  • Eric Lafortune

    Eric Lafortune - 2015-01-27

    Thanks for your report. The problem is still a bit hard to track down based on the error log. Would it be possible to reduce it to a test case that allows me to reproduce the problem?

    Side-note: don't use -assumenosideeffects with a wildcard '*'. It matches all methods, including methods like Object.wait(), for all objects. Removing those invocations can lead to serious problems.

     
  • Scott W Palmer

    Scott W Palmer - 2019-01-22

    I'm now getting this error with 6.1beta2 where I wasn't with 6.0.x

    java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.
    Exception Details:
      Location:
        ca/mycompany/thing/gui/startup/StartupHelper$2.pluginHasLoaded(Lca/mycompany/thing/plugin/PluginEntry;)V @17: invokespecial
      Reason:
        Error exists in the bytecode
      Bytecode:
        0000000: 2ab4 0006 59b4 0005 0460 b500 052a b400
        0000010: 06b7 0007 b1                           
    
        at ca.mycompany.thing.gui.startup.StartupHelper.startup(SourceFile:2229)
        at ca.mycompany.thing.Main.main(SourceFile:37)
    
     

    Last edit: Scott W Palmer 2019-01-22
  • Scott W Palmer

    Scott W Palmer - 2019-01-22

    Another case:

    01-21 11:36:52 WARNING ProductPluginCodeGenMain [main]: Code Gen Caught: java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.
    Exception Details:
      Location:
        ca/mycompany/product/graph/ProductComponentRegistry$RegistryEntry.getResolvedDefinition()Lca/mycompany/product/plugin/xml/ProductComponentDefinition; @52: invokespecial
      Reason:
        Error exists in the bytecode
      Bytecode:
        0000000: 2ab4 000c 9900 082a b400 0db0 2ab4 000a
        0000010: b400 0959 4cc2 2ab4 000d c700 222a 59b4
        0000020: 000a 2ab4 000b b600 11b5 000d 2ab4 000a
        0000030: 2ab4 000d b700 0e2a 04b5 000c 2bc3 a700
        0000040: 084d 2bc3 2cbf 2ab4 000d b0            
      Exception Handler Table:
        bci [22, 62] => handler: 65
        bci [65, 68] => handler: 65
      Stackmap Table:
        same_frame(@12)
        append_frame(@60,Object[#6])
        full_frame(@65,{Top,Object[#6]},{Object[#8]})
        full_frame(@70,{Object[#2]},{})
    
            at ca.mycompany.product.graph.ProductComponentRegistry.registerComponentDefinition(SourceFile:379)
            at ca.mycompany.product.plugin.ProductPluginsMgr.a(SourceFile:682)
            at ca.mycompany.product.plugin.ProductPluginsMgr.prepareForCodeGeneration(SourceFile:176)
            at ca.mycompany.product.plugin.codegen.ProductPluginCodeGenMain.main(SourceFile:58)
    
     

    Related

    Bugs: #2
    Bugs: #6
    Bugs: #8

  • Neil Katz

    Neil Katz - 2019-06-10

    I'm also seeing this bug, both with 6.1beta2 and 6.1.1. Question for https://sourceforge.net/u/cfxmarvin/ -- did you find a workaround?

     
  • Scott W Palmer

    Scott W Palmer - 2019-06-24

    @katznm I have not found a workaround. Currently building with anything later than Java 8 has multiple issues (e.g. transitive dependencies that aren't happy), so I haven't investigated further.

     
  • Neil Katz

    Neil Katz - 2019-07-18

    I suspect this is the same bug as https://sourceforge.net/p/proguard/bugs/757/

     

Log in to post a comment.

MongoDB Logo MongoDB