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

Usages of is_object_aligned with pointers are broken

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • Resolved In Build:
      b21

      Description

      is_object_aligned only works correctly for sizes measured in words.

      When a pointer is passed into:
      inline bool is_object_aligned(intptr_t addr) {
        return addr == align_object_size(addr);
      }

      inline intptr_t align_object_size(intptr_t size) {
        return align_size_up(size, MinObjAlignment);
      }

      the pointer is incorrectly interpreted as a word size and the alignment is checked against MinObjectAligment instead of MinObjectAlignmentInBytes.

      This was found while working on JDK-8178489.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stefank Stefan Karlsson
              Reporter:
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: