java.lang.VerifyError: Expecting a stackmap frame at branch target 52 Exception Details: Location: WeavingTest/Weaving.printWeaving()V @15: ifne Reason: Expected stackmap frame at this location. Bytecode: 0x0000000: b200 422a 2ab8 0048 4cb2 0067 b600 6d9a 0x0000010: 0025 b800 5d05 bd00 0e4d 2c03 2a53 2c04 0x0000020: 2b53 bb00 4d59 2cb7 0050 1251 b600 57b6 0x0000030: 0061 57b1 2a2b b800 63b1

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 2#663621
    via GitHub by Zwoz
    ,
  • java.lang.VerifyError
    via by Ewout Van Gossum,
  • Error: Expecting a stackmap frame
    via GitHub by kajdreef
    ,
  • In nested finally blocks, a VerifyError occurs when attempting to pattern match on a caught exception. Minimal test case: {code}object Test { def unapply(t: Throwable): Option[Throwable] = Some(t) } object Main{ def main(args: Array[String]) { try { () } finally { try { () } finally { try { throw null } catch { case Test(_) => } } } } }{code} Expected output is empty. With -Xoldpatmat, no errors occur. Without -Xoldpatmat, on both 2.10.3 and 2.11.2, the error is as follows: {noformat} Exception in thread "main" java.lang.VerifyError: Bad local variable type Exception Details: Location: Main$.main([Ljava/lang/String;)V @144: aload Reason: Type top (current frame, locals[8]) is not assignable to reference type Current Frame: bci: @144 flags: { } locals: { 'Main$', '[Ljava/lang/String;', top, top, 'java/lang/Throwable', 'java/lang/Throwable', 'scala/Option', 'scala/runtime/BoxedUnit' } stack: { } Bytecode: 0000000: 01bf bf00 bfbf 00bf 00bf 0000 00bf 0000 0000010: 0000 0000 0000 00bf 0000 0000 0000 00bf 0000020: 0000 bf00 0000 00bf 00bf 00bf 0000 00bf 0000030: 0000 0000 0000 0000 00bf 0000 0000 0000 0000040: 00bf 0000 bf00 0000 00bf 00bf 00bf 00bf 0000050: 00bf 0000 00bf 0000 0000 0000 0000 00bf 0000060: 0000 0000 0000 00bf 0000 0000 bf00 00bf 0000070: 3a04 1904 3a05 b200 1319 05b6 0017 3a06 0000080: 1906 b600 1d99 0006 1904 bfb2 0023 3a07 0000090: 1908 bf Exception Handler Table: bci [0, 2] => handler: 112 Stackmap Table: full_frame(@2,{},{Object[#40]}) same_locals_1_stack_item_frame(@3,Object[#40]) same_locals_1_stack_item_frame(@5,Object[#40]) same_locals_1_stack_item_frame(@6,Object[#40]) same_locals_1_stack_item_frame(@8,Object[#40]) same_locals_1_stack_item_frame(@10,Object[#40]) same_locals_1_stack_item_frame(@14,Object[#40]) same_locals_1_stack_item_frame(@24,Object[#40]) same_locals_1_stack_item_frame(@32,Object[#40]) same_locals_1_stack_item_frame(@35,Object[#40]) same_locals_1_stack_item_frame(@40,Object[#40]) same_locals_1_stack_item_frame(@42,Object[#40]) same_locals_1_stack_item_frame(@44,Object[#40]) same_locals_1_stack_item_frame(@48,Object[#40]) same_locals_1_stack_item_frame(@58,Object[#40]) same_locals_1_stack_item_frame(@66,Object[#40]) same_locals_1_stack_item_frame(@69,Object[#40]) same_locals_1_stack_item_frame(@74,Object[#40]) same_locals_1_stack_item_frame(@76,Object[#40]) same_locals_1_stack_item_frame(@78,Object[#40]) same_locals_1_stack_item_frame(@80,Object[#40]) same_locals_1_stack_item_frame(@82,Object[#40]) same_locals_1_stack_item_frame(@86,Object[#40]) same_locals_1_stack_item_frame(@96,Object[#40]) same_locals_1_stack_item_frame(@104,Object[#40]) same_locals_1_stack_item_frame(@109,Object[#40]) full_frame(@112,{Object[#2],Object[#41]},{Object[#40]}) full_frame(@136,{Object[#2],Object[#41],Top,Top,Object[#40],Object[#40],Object[#25]},{}) same_frame(@139) append_frame(@144,Object[#31]) at Main.main(test.scala) {noformat} Note also that is one level of try/finally is removed the issue does not occur.
    via by William Owen Parry,
    • java.lang.VerifyError: Expecting a stackmap frame at branch target 52 Exception Details: Location: WeavingTest/Weaving.printWeaving()V @15: ifne Reason: Expected stackmap frame at this location. Bytecode: 0x0000000: b200 422a 2ab8 0048 4cb2 0067 b600 6d9a 0x0000010: 0025 b800 5d05 bd00 0e4d 2c03 2a53 2c04 0x0000020: 2b53 bb00 4d59 2cb7 0050 1251 b600 57b6 0x0000030: 0061 57b1 2a2b b800 63b1 at Main.main(Main.java:13)
    No Bugmate found.