JDK-8329534 : java.lang.VerifyError: Inconsistent stackmap frames at branch target 56
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 23
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: x86_64
  • Submitted: 2024-04-01
  • Updated: 2025-05-08
  • Resolved: 2025-05-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25Resolved
Related Reports
Duplicate :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
```bash
$ cat /etc/os-release
VERSION="22.04.4 LTS (Jammy Jellyfish)"

$ oracle-jdk-21.0.2/bin/java -version
java version "21.0.2" 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)

$ oracle-jdk-17.0.10/bin/java -version
java version "17.0.10" 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 17.0.10+11-LTS-240)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.10+11-LTS-240, mixed mode, sharing)

$ jdk23u/bin/java -version
openjdk version "23-internal" 2024-09-17
OpenJDK Runtime Environment (fastdebug build 23-internal-adhoc.jdk23u)
OpenJDK 64-Bit Server VM (fastdebug build 23-internal-adhoc.jdk23u, mixed mode)
```

A DESCRIPTION OF THE PROBLEM :
When I compile and execute the following code using the JVM (from JDK 8 to JDK 23), the JVM crashes.

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

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
running without error
ACTUAL -
Error: Unable to initialize main class Test
Caused by: java.lang.VerifyError: Inconsistent stackmap frames at branch target 56
Exception Details:
  Location:
    Test.mainTest()V @56: dload_3
  Reason:
    Type top (current frame, locals[5]) is not assignable to integer (stack map, locals[5])
  Current Frame:
    bci: @36
    flags: { }
    locals: { 'Test', integer, integer, double, double_2nd }
    stack: { integer }
  Stackmap Frame:
    bci: @56
    flags: { }
    locals: { 'Test', integer, integer, double, double_2nd, integer }
    stack: { }
  Bytecode:
    0000000: 11f6 dc3c 1199 493d 1400 024a 1204 3805
    0000010: 1b17 058b 683c a700 0384 0201 1c11 00b2
    0000020: a1ff ec04 ab00 0000 0000 0014 0000 0001
    0000030: 0000 0044 0000 0014 291c 8763 4ab1     
  Stackmap Table:
    append_frame(@12,Integer,Integer,Double)
    same_frame(@25)
    append_frame(@56,Integer)



---------- BEGIN SOURCE ----------
public class Test {

  public void mainTest() {
    int i15 = -2340, i16 = -26295;
    double d2 = 0.14520;
    do {
      float f1 = 14.252F;
      i15 *= (int) f1;
      if (true) continue;
    } while (++i16 < 178);
    switch (1) {
      case 68:
        boolean var9;
      default:
        d2 += i16;
    }
  }

  public static void main(String[] strArr) {
    Test _instance = new Test();
    _instance.mainTest();
  }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
Looks similar to JDK-8332934 - might have the same underlying cause.
06-09-2024