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

[AArch64] C2 compilation hits offset_ok_for_immed: assert "c2 compiler bug"

XMLWordPrintable

    • b13
    • aarch64

      Fails only with debug, in product we simply "legitimize_address", which inserts a LEA instruction to handle the offset that seems to require more bits than expected.

      I reproduced it like this:

      /scratch/empeter/jdk-22/fastdebug/bin/java --add-modules java.base --add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-exports java.base/jdk.internal.util=ALL-UNNAMED -Xcomp -XX:-TieredCompilation -XX:MaxHeapSize=805306368 -XX:MaxRAMPercentage=6.250000 "-XX:CompileCommand=compileonly,Test*::<clinit>" -XX:CompileCommand=printcompilation,Test*::* Test.java


      CompileCommand: compileonly Test*.<clinit> bool compileonly = true
      CompileCommand: PrintCompilation Test*.* bool PrintCompilation = true
      2676 105 b Test::<clinit> (7 bytes)
      2681 107 b Test$A::<clinit> (44 bytes)
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/afbc6042-3a24-4198-9369-18c663a3f74c-S45433/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/10db9974-e79d-49fb-b2a8-fc7dc441748b/runs/b6e6453a-891d-4130-a6a2-b2df8c26912c/workspace/open/src/hotspot/cpu/aarch64/aarch64.ad:2741), pid=134414, tid=134428
      # assert(Address::offset_ok_for_immed(addr.offset(), exact_log2(size_in_memory))) failed: c2 compiler bug
      #
      # JRE version: Java(TM) SE Runtime Environment (22.0+22) (fastdebug build 22-ea+22-1754)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 22-ea+22-1754, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
      # Problematic frame:
      # V [libjvm.so+0x424248] loadStore(C2_MacroAssembler, void (MacroAssembler::*)(Register, Address const&), Register, int, Register, int, int, int, int) [clone .constprop.1]+0x1f8
      #
      # Core dump will be written. Default location: /scratch/empeter/jdk-fork1/build/linux-aarch64-slowdebug/jdk/bin/core.134414
      #
      # An error report file with more information is saved as:
      # /scratch/empeter/jdk-fork1/build/linux-aarch64-slowdebug/jdk/bin/hs_err_pid134414.log
      #
      # Compiler replay data is saved as:
      # /scratch/empeter/jdk-fork1/build/linux-aarch64-slowdebug/jdk/bin/replay_pid134414.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_pid134414.log
          162 kB
        2. replay_pid134414.log
          239 kB
        3. Test.java
          1 kB

            epeter Emanuel Peter
            epeter Emanuel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: