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

Dying objects are published from users of CollectedHeap::object_iterate

    XMLWordPrintable

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b27
    • Verification:
      Verified

      Backports

        Description

        Caution needs to be taken when CollectedHeap::object_iterate is used. It may:
        - Return non-reachable objects - for example, when G1 walks the prev bitmap
        - Return the Reference.referent without an appropriate resurrection barrier
        - Return an object loaded without a "strong"/"marking" barrier

        These objects should not escape the confines of the active safepoint that calls object_iterate. If they do we run the risk of various crashes when the objects get garbage collected.

        Unfortunately, there are a few closures that do this. The once we have identified are:
        - HeapInspection::find_instances_at_safepoint
        - JVMTI object tagging

        There might be some merit to solving this by altering the object_iterate API, but for now we'd like to fix the two problematic areas listed above. The suggestion is to introduce a CollectedHeap::keep_alive function that notifies the GC that the object should be kept alive the current GC cycle (if active).

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: