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

ZGC: Regression after JDK-8338442, crash assert(offset_ok_for_immed(offset(), size)) failed: must be, was: 32776, 3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 24
    • hotspot

      JDK-8338442 replaced the addressable memoryN operands with memory operands which may require extra code emission (effectively a lea) before the address can be used. However this must be done explicitly (`Address legitimize_address(const Address &a, int size, Register scratch)` exists as a helper).

      Part of the fix for ZGC seems to confusingly have been included in JDK-8336245. And JDK-8338442 only fixed the memoryN, but not the existing memory. So it is missing for the `zStoreP` instruction matching.

      For any current (that I know of) vm page size, we should not be susceptible to JDK-8340646 (ImplicitNullChecks bugs) as oop fields are always 8 byte aligned (with ZGC). But this seems fragile regardless and hopefully JDK-8340646 can provide a better solution to the ImplicitNullChecks interactions.

      Mainline currently crashes with the attached reproducer.
      macosx-aarch64-debug % ./images/jdk/bin/java -XX:-TieredCompilation -Xbatch -XX:+UseZGC Reproducer.java
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (.../open/src/hotspot/cpu/aarch64/assembler_aarch64.hpp:549), pid=4047, tid=34819
      # assert(offset_ok_for_immed(offset(), size)) failed: must be, was: 32776, 3
      #
      # JRE version: Java(TM) SE Runtime Environment (24.0) (fastdebug build 24-internal-2024-10-02-1737339.xmas92...)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-internal-2024-10-02-1737339.xmas92..., mixed mode, sharing, compressed class ptrs, z gc, bsd-aarch64)

      And with JDK-8338442 reverted (git revert 38591315058e6d3b764ca325facc5bf46bf7b16b) it passes.

            fgao Fei Gao
            aboldtch Axel Boldt-Christmas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: