JDK-8357242 : java.lang.VerifyError: Inconsistent stackmap frames at branch target 68
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8,24
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2025-05-19
  • Updated: 2025-05-19
  • Resolved: 2025-05-19
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
$ /home/user/tools/jdk-21.0.7/bin/java -version
java version "21.0.7" 2025-04-15 LTS
Java(TM) SE Runtime Environment (build 21.0.7+8-LTS-245)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.7+8-LTS-245, mixed mode, sharing)

$ /home/user/tools/jdk-21.0.7/bin/javac -version
javac 21.0.7

A DESCRIPTION OF THE PROBLEM :
When we run the code using the JDK downloaded from Oracle, a VerifyError occurs, although we did not find any obvious issues in our code.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
javac Test.java && java Test

ACTUAL -
Error: Unable to initialize main class Test
Caused by: java.lang.VerifyError: Inconsistent stackmap frames at branch target 68
Exception Details:
  Location:
    Test.main([Ljava/lang/String;)V @68: iload_1
  Reason:
    Type top (current frame, locals[3]) is not assignable to integer (stack map, locals[3])
  Current Frame:
    bci: @40
    flags: { }
    locals: { '[Ljava/lang/String;', integer, integer }
    stack: { integer }
  Stackmap Frame:
    bci: @68
    flags: { }
    locals: { '[Ljava/lang/String;', integer, integer, integer }
    stack: { }
  Bytecode:
    0000000: 1033 3c11 00bb 3d10 6eab 0000 0000 0041
    0000010: 0000 0001 0000 006e 0000 0013 033e a700
    0000020: 031c 05a1 fff9 1038 ab00 0000 0000 0022
    0000030: 0000 0002 0000 0038 0000 001c 0000 0039
    0000040: 0000 001c 1b11 6f3c 683c b1            
  Stackmap Table:
    append_frame(@28,Integer,Integer)
    same_frame(@33)
    append_frame(@68,Integer)
    chop_frame(@74,1)



---------- BEGIN SOURCE ----------
class Test {
    public static void main(String[] args) {

        int i27 = 51, i30 = 187;
        switch (110) {
            case 110:
                do {
                    int var26 = 0;
                    continue;
                } while (i30 < 2);
                switch (56) {
                    case 56:
                        int var6;
                    case 57:
                        i27 *= 28476;
                }
        }
    }
}

---------- END SOURCE ----------


Comments
Fixed the link by replacing the "relates to" link to a "duplicates" link.
19-05-2025

Impact -> M (Somewhere in-between the extremes) Likelihood -> M (Somewhere in-between the extremes) Workaround -> L (Using the newer version JDK, JDK 25ea+22) Priority -> P4
19-05-2025

The observations on Windows 11: JDK 25ea+22: Passed. It looks like JDK-8332934 fixed the issue. Closed as a duplicate of JDK-8332934.
19-05-2025