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

[REDO] G1DirtyCardQueue destructor has useless flush

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 15
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc

      Description

       ~G1DirtyCardQueue calls flush(), but that's too late. The final flush must occur in on_thread_detach(), with no further queued log entries after that, else operations like concatenate_logs won't be able to find and process those late logs. on_thread_detach() already contains the necessary flush(), so the one in the destructor is just a waste of time, and possibly hides bugs. Better to just remove it.

      However, it's not so simple as just removing the call (and possibly the now empty destructor). There are bootstrapping problems (see JDK-8240722). There are write barrier invocations by the initial thread before it has been added to the threads list (which includes calling BarrierSet::on_thread_attach). Those are occurring in init_globals. If init_globals ultimately returns failure, the initial thread gets deleted, without calling BarrierSet::on_thread_detach (where the flush would normally occur for a running thread being deleted). This leaves a partially filled buffer in place, triggering the assert in ~PtrQueue.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kbarrett Kim Barrett
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: