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

Incorrect alignment in CDS related allocation code on 32-bit platforms

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 11, 12, 13
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      Problem reported by fedor.burdun@azul.com:

      I've found an inconsistency in CDS related Klass* reallocating code, in method

              static void ArchiveCompactor::allocate(MetaspaceClosure::Ref* ref, bool read_only) (src/hotspot/share/memory/metaspaceShared.cpp:1122)

      the alignment = BytesPerWord has been used, that is fine for 64bit platforms, but may cause problems on 32bit ones.
      For example, in case of ARM gcc compiles accessors for u8/long long types using ldrd/strd instructions that requires a double-word alignment on ARMv5TE and older.

      Moreover the method (although it used only for compressed oops)

              inline bool check_klass_alignment(Klass* obj) in src/hotspot/share/oops/klass.inline.hpp

      checks classes to be aligned to KlassAlignment const, not to the BytesPerWord one.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ccheung Calvin Cheung
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: