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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 16
    • 11, 12, 13
    • hotspot
    • b19
    • x86
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: