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

Return address mask creation fails with assert(reg < CHUNK_SIZE) failed: sanity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 23
    • 17, 21, 23
    • hotspot
    • Cause Known

      # Failure analysis

      The large number of synchronized statements in the test results in that the return address cannot fit in a register mask. There is no guard before constructing this register mask, resulting in the assert failure.

      # Original description

      C2 fails to compile the attached Test.java consisting of deeply nested synchronize statements. This issue is an edge case revealed when investigating JDK-8322996. See the comments in Test.java for additional information.

      $ java -XX:CompileCommand=compileonly,Test::test* -XX:-TieredCompilation -Xcomp Test.java
      CompileCommand: compileonly Test.test* bool compileonly = true
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/home/dlunden/jdk-box-lock-node-8322996/open/src/hotspot/share/opto/regmask.hpp:299), pid=258248, tid=258262
      # assert(reg < CHUNK_SIZE) failed: sanity
      #
      # JRE version: Java(TM) SE Runtime Environment (23.0) (slowdebug build 23-internal-2024-01-26-0943371.dlunden...)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 23-internal-2024-01-26-0943371.dlunden..., compiled mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x883348] RegMask::Insert(int)+0xf6
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/dlunden/oracle/issues/return-mask/core.258248)
      #
      # An error report file with more information is saved as:
      # /home/dlunden/oracle/issues/return-mask/hs_err_pid258248.log
      #
      # Compiler replay data is saved as:
      # /home/dlunden/oracle/issues/return-mask/replay_pid258248.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #
      Aborted (core dumped)

        1. hs_err_pid258248.log
          77 kB
        2. replay_pid258248.log
          245 kB
        3. Test.java
          3 kB

            dlunden Daniel Lunden
            dlunden Daniel Lunden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: