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

Memory fences needed around setting and reading object lengths

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc

      Description

      The size of arrays and java.lang.Class instances are stored in "length" and "oop_size" fields within the object. The contract for object initialization is that once the object header has been set non-zero (the klass field in particular), the object is parsable by concurrent GCs.

      Although the source code is writing the fields in the correct order (after JDK-8158946 is fixed), there are no memory fences to ensure that the compiler or CPU doesn't reorder the writes or reads of these fields.

        Attachments

          Issue Links

          There are no Sub-Tasks for this issue.

            Activity

              People

              • Assignee:
                kbarrett Kim Barrett
                Reporter:
                drwhite Derek White
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: