java.lang.VerifyError: Inconsistent stackmap frames at branch target 82 Exception Details: Location: SwitchCompilerErr.switchTo()V @82: new Reason: Type top (current frame, locals[3]) is not assignable to 'java/lang/String' (stack map, locals[3]) Current Frame: bci: @57 flags: { } locals: { 'SwitchCompilerErr', integer, integer } stack: { integer } Stackmap Frame: bci: @82 flags: { } locals: { 'SwitchCompilerErr', integer, integer, 'java/lang/String' } stack: { } Bytecode: 0x0000000: bb00 0259 b700 03b6 0004 3cbb 0002 59b7 0x0000010: 0003 b600 043d 1bab 0000 0017 0000 0001 0x0000020: 0000 0000 0000 0011 1205 4ea7 000d bb00 0x0000030: 0659 1207 b700 08bf 1cab 0000 0000 0019 0x0000040: 0000 0001 0000 0000 0000 0013 1205 4ea7 0x0000050: 000d bb00 0659 1207 b700 08bf b1 Stackmap Table: append_frame(@40,Integer,Integer) same_frame(@46) same_frame(@56) same_frame(@76) append_frame(@82,Object[#19]) chop_frame(@92,1)

JDK Bug System | Webbug Group | 5 months ago
  1. 0

    FULL PRODUCT VERSION : java version "1.8.0_92" Java(TM) SE Runtime Environment (build 1.8.0_92-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode) ADDITIONAL OS VERSION INFORMATION : 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux A DESCRIPTION OF THE PROBLEM : Class compiles but fails to load: Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 82 Exception Details: Location: SwitchCompilerErr.switchTo()V @82: new Reason: Type top (current frame, locals[3]) is not assignable to 'java/lang/String' (stack map, locals[3]) Current Frame: bci: @57 flags: { } locals: { 'SwitchCompilerErr', integer, integer } stack: { integer } Stackmap Frame: bci: @82 flags: { } locals: { 'SwitchCompilerErr', integer, integer, 'java/lang/String' } stack: { } Bytecode: 0x0000000: bb00 0259 b700 03b6 0004 3cbb 0002 59b7 0x0000010: 0003 b600 043d 1bab 0000 0017 0000 0001 0x0000020: 0000 0000 0000 0011 1205 4ea7 000d bb00 0x0000030: 0659 1207 b700 08bf 1cab 0000 0000 0019 0x0000040: 0000 0001 0000 0000 0000 0013 1205 4ea7 0x0000050: 000d bb00 0659 1207 b700 08bf b1 Stackmap Table: append_frame(@40,Integer,Integer) same_frame(@46) same_frame(@56) same_frame(@76) append_frame(@82,Object[#19]) chop_frame(@92,1) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) REGRESSION. Last worked in version 7u76 ADDITIONAL REGRESSION INFORMATION: java version "1.7.0_76" Java(TM) SE Runtime Environment (build 1.7.0_76-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : compile and run supplied code EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - expected to load and execute ACTUAL - Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 82 Exception Details: Location: SwitchCompilerErr.switchTo()V @82: new Reason: Type top (current frame, locals[3]) is not assignable to 'java/lang/String' (stack map, locals[3]) Current Frame: bci: @57 flags: { } locals: { 'SwitchCompilerErr', integer, integer } stack: { integer } Stackmap Frame: bci: @82 flags: { } locals: { 'SwitchCompilerErr', integer, integer, 'java/lang/String' } stack: { } Bytecode: 0x0000000: bb00 0259 b700 03b6 0004 3cbb 0002 59b7 0x0000010: 0003 b600 043d 1bab 0000 0017 0000 0001 0x0000020: 0000 0000 0000 0011 1205 4ea7 000d bb00 0x0000030: 0659 1207 b700 08bf 1cab 0000 0000 0019 0x0000040: 0000 0001 0000 0000 0000 0013 1205 4ea7 0x0000050: 000d bb00 0659 1207 b700 08bf b1 Stackmap Table: append_frame(@40,Integer,Integer) same_frame(@46) same_frame(@56) same_frame(@76) append_frame(@82,Object[#19]) chop_frame(@92,1) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- import java.util.Random; public class SwitchCompilerErr { private void switchTo() throws Exception { int e = new Random().nextInt(); int m = new Random().nextInt(); switch (e) { case 0: String a = ""; break; default: throw new Exception("Unknown "); } // String z = ""; switch (m) { case 0: String b = ""; break; default: throw new Exception("Unknown "); } } public static void main(String[] args) throws Exception { new SwitchCompilerErr().switchTo(); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : inserting variable definition in between switch statements prevents this issue

    JDK Bug System | 5 months ago | Webbug Group
    java.lang.VerifyError: Inconsistent stackmap frames at branch target 82 Exception Details: Location: SwitchCompilerErr.switchTo()V @82: new Reason: Type top (current frame, locals[3]) is not assignable to 'java/lang/String' (stack map, locals[3]) Current Frame: bci: @57 flags: { } locals: { 'SwitchCompilerErr', integer, integer } stack: { integer } Stackmap Frame: bci: @82 flags: { } locals: { 'SwitchCompilerErr', integer, integer, 'java/lang/String' } stack: { } Bytecode: 0x0000000: bb00 0259 b700 03b6 0004 3cbb 0002 59b7 0x0000010: 0003 b600 043d 1bab 0000 0017 0000 0001 0x0000020: 0000 0000 0000 0011 1205 4ea7 000d bb00 0x0000030: 0659 1207 b700 08bf 1cab 0000 0000 0019 0x0000040: 0000 0001 0000 0000 0000 0013 1205 4ea7 0x0000050: 000d bb00 0659 1207 b700 08bf b1 Stackmap Table: append_frame(@40,Integer,Integer) same_frame(@46) same_frame(@56) same_frame(@76) append_frame(@82,Object[#19]) chop_frame(@92,1)
  2. 0

    Calling an Extension Method While Invoking A Method Throws Verify Error: Bad type on operand stack

    GitHub | 10 months ago | ntroutman
    java.lang.VerifyError: Bad type on operand stack Exception Details: Location: VerifyErrorBadOperandLombokExtensionMethodTest.main([Ljava/lang/String;)V @19: checkcast Reason: Type integer (current frame, stack[1]) is not assignable to 'java/lang/Object' Current Frame: bci: @19 flags: { } locals: { '[Ljava/lang/String;', 'VerifyErrorBadOperandLombokExtensionMethodTest$CanReturnInt' } stack: { 'java/lang/Object', integer } Bytecode: 0x0000000: bb00 1059 b700 124c bb00 0359 b700 082b 0x0000010: b600 13c0 0017 b800 19b2 001f 1225 b600 0x0000020: 27b1
  3. 0

    GitHub comment 65#191043845

    GitHub | 9 months ago | Storyyeller
    java.lang.VerifyError: Bad instruction: a8 Exception Details: Location: Confusion.main([Ljava/lang/String;)V @0: jsr Reason: Error exists in the bytecode Bytecode: 0x0000000: a800 1cb2 0008 1201 b600 09b1 0304 b800 0x0000010: 0a99 0007 57a7 0007 5f4c a901 a8ff f0b2 0x0000020: 0008 1202 b600 09b1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    StackMapTable attribute not generated automatically

    GitHub | 8 months ago | toddATavail
    java.lang.VerifyError: Expecting a stackmap frame at branch target 25 Exception Details: Location: SumIntegersApp.main([Ljava/lang/String;)V @7: if_icmpge Reason: Expected stackmap frame at this location. Bytecode: 0x0000000: 0359 3c3d 1c2a bea2 0012 2a1c 32b8 0006 0x0000010: 1b60 3c84 0201 a7ff eeb2 0007 1bb6 0008 0x0000020: b1
  6. 0

    FULL PRODUCT VERSION : java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) Client VM (build 25.102-b14, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.1.7601] A DESCRIPTION OF THE PROBLEM : This appears to be quite similar to JDK-8129740 but does not involve lambdas. The code compiles but produces VerifyError when runs. Possibly the compiler should not have allowed it at all, as the anonymous inner class is non-static code in the class being instantiated, and the supertype constructor has not been entered yet. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Compile and run the supplied code. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Probably a compiler error. ACTUAL - Successful compilation, but a runtime error. ERROR MESSAGES/STACK TRACES THAT OCCUR : Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.VerifyError: Bad type on operand stack Exception Details: Location: javacbug.<init>()V @18: invokespecial Reason: Type uninitializedThis (current frame, stack[3]) is not assignable to 'javacbug' Current Frame: bci: @18 flags: { flagThisUninit } locals: { uninitializedThis } stack: { uninitializedThis, uninitialized 1, uninitialized 1, uninitializedThis, 'Outer' } Bytecode: 0x0000000: 2abb 0001 592a bb00 0259 b700 0359 b600 0x0000010: 0457 b700 05b7 0006 b1 at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- class Base { Base(Object o) {} } class Outer { class Inner {} } class javacbug extends Base { javacbug() { super(new Outer().new Inner() {}); } public static void main(String[] args) { new javacbug(); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Instantiate the Inner object somewhere else; either a static method, or after the supertype constructor has returned.

    JDK Bug System | 3 months ago | Webbug Group
    java.lang.VerifyError: Bad type on operand stack Exception Details: Location: javacbug.<init>()V @18: invokespecial Reason: Type uninitializedThis (current frame, stack[3]) is not assignable to 'javacbug' Current Frame: bci: @18 flags: { flagThisUninit } locals: { uninitializedThis } stack: { uninitializedThis, uninitialized 1, uninitialized 1, uninitializedThis, 'Outer' } Bytecode: 0x0000000: 2abb 0001 592a bb00 0259 b700 0359 b600 0x0000010: 0457 b700 05b7 0006 b1

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.VerifyError

      Inconsistent stackmap frames at branch target 82 Exception Details: Location: SwitchCompilerErr.switchTo()V @82: new Reason: Type top (current frame, locals[3]) is not assignable to 'java/lang/String' (stack map, locals[3]) Current Frame: bci: @57 flags: { } locals: { 'SwitchCompilerErr', integer, integer } stack: { integer } Stackmap Frame: bci: @82 flags: { } locals: { 'SwitchCompilerErr', integer, integer, 'java/lang/String' } stack: { } Bytecode: 0x0000000: bb00 0259 b700 03b6 0004 3cbb 0002 59b7 0x0000010: 0003 b600 043d 1bab 0000 0017 0000 0001 0x0000020: 0000 0000 0000 0011 1205 4ea7 000d bb00 0x0000030: 0659 1207 b700 08bf 1cab 0000 0000 0019 0x0000040: 0000 0001 0000 0000 0000 0013 1205 4ea7 0x0000050: 000d bb00 0659 1207 b700 08bf b1 Stackmap Table: append_frame(@40,Integer,Integer) same_frame(@46) same_frame(@56) same_frame(@76) append_frame(@82,Object[#19]) chop_frame(@92,1)

      at java.lang.Class.getDeclaredMethods0()
    2. Java RT
      LauncherHelper.checkAndLoadMain
      1. java.lang.Class.getDeclaredMethods0(Native Method)
      2. java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      3. java.lang.Class.privateGetMethodRecursive(Class.java:3048)
      4. java.lang.Class.getMethod0(Class.java:3018)
      5. java.lang.Class.getMethod(Class.java:1784)
      6. sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
      7. sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
      7 frames