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

Fix for JDK-8361447 breaks the alignment requirements for GuardedMemory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2 P2
    • 26
    • 8
    • hotspot
    • In Review

      The fix for JDK-8361447 added a new field to the GuardHeader, not realizing that the size of the GuardHeader must be such that the address of the user-data has the strictest necessary alignment (16-byte).

      We need to add a padding field to restore the alignment.

      This is not generally a problem as since JDK 19 (JDK-8277822) the only use of `GuardedMemory` is for -Xcheck:jni, but Java arrays only have 8-byte alignment to begin with so are unaffected in normal use.

      Prior to JDK 19 VM code only used GuardedMemory in debug builds, and no such usage had such a strict alignment requirement since some ZGC code in JDK 17 (it used movaps to process data).

            dholmes David Holmes
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: