Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8343156

java.lang.VerifyError: Inconsistent stackmap frames at branch target 72

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 21.0.5-oracle, 24
    • tools
    • x86_64
    • linux_ubuntu

      ADDITIONAL SYSTEM INFORMATION :
      $ cat /etc/os-release
      PRETTY_NAME="Ubuntu 22.04.4 LTS"
      NAME="Ubuntu"
      VERSION_ID="22.04"
      VERSION="22.04.4 LTS (Jammy Jellyfish)"
      VERSION_CODENAME=jammy
      ID=ubuntu
      ID_LIKE=debian
      HOME_URL="https://www.ubuntu.com/"
      SUPPORT_URL="https://help.ubuntu.com/"
      BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
      PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
      UBUNTU_CODENAME=jammy

      $ java -version
      java version "21.0.5" 2024-10-15 LTS
      Java(TM) SE Runtime Environment (build 21.0.5+9-LTS-239)
      Java HotSpot(TM) 64-Bit Server VM (build 21.0.5+9-LTS-239, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      When running the following testcase with Oracle JDK 21.0.5 and Oracle JDK 17.0.13, errors occur. We have simplified the testcase to some extent, and currently, no code structures that would clearly cause the issue have been identified. It is unclear what is causing the errors: Unable to initialize main class Test and java.lang.VerifyError: Inconsistent stackmap frames at branch target 72.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      javac -source 17 -target 17 -Xlint:none -encoding UTF-8 -cp . Test.java
      java Test

      ACTUAL -
      Error: Unable to initialize main class Test
      Caused by: java.lang.VerifyError: Inconsistent stackmap frames at branch target 72
      Exception Details:
        Location:
          Test.main([Ljava/lang/String;)V @72: iload_3
        Reason:
          Type top (current frame, locals[4]) is not assignable to float (stack map, locals[4])
        Current Frame:
          bci: @44
          flags: { }
          locals: { '[Ljava/lang/String;', integer, integer, integer }
          stack: { integer }
        Stackmap Frame:
          bci: @72
          flags: { }
          locals: { '[Ljava/lang/String;', integer, integer, integer, float }
          stack: { }
        Bytecode:
          0000000: 033c 1009 3d04 3e10 06ab 0000 0000 0041
          0000010: 0000 0001 0000 0001 0000 0013 1b36 0484
          0000020: 0201 a700 031c 1207 a1ff f407 ab00 0000
          0000030: 0000 001e 0000 0002 0000 0008 0000 001c
          0000040: 0000 001c 0000 001c 1d3c b1
        Stackmap Table:
          append_frame(@28,Integer,Integer,Integer)
          same_frame(@37)
          append_frame(@72,Float)
          chop_frame(@74,1)



      ---------- BEGIN SOURCE ----------
      class Test {
          public static void main(String[] g) {
              int c = 0;
              int i = 9;
              int d = 1;
              switch (6) {
                  case 1:
                      do {
                          int e = c;
                          i ++;
                          continue;
                      } while (i < 100000);
                      switch (4) {
                          case 8:
                              float f;
                          case 28:
                              c = d;
                      }
              }
          }
      }

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

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: