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: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 12, 13
    • Fix Version/s: 16
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b19
    • 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

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: