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

Fix GlobalCounter shutdown problem with remembered set

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 19, 20
    • hotspot
    • None
    • gc

      In JDK-8290867 we hackfixed a crash during VM shutdown related to GlobalCounter usage by explicitly conditionalizing that usage.

      "VM shutdown calls the the destructor for the (global) free list pool, which in turn frees all segments; however at that time the VM is not in a state where GlobalCounter works (threads are detached, no valid threads list) and crashes. The last commit provides a workaround for that issue, not doing the global synchronization when shutting down. That is safe because the process is single-threaded in the VM_Exit operation anyway. This is a workaround for this issue that needs to be cleaned up, but it's too late imho in the release to find a better solution for this issue."

      Look for alternatives there.

      Here is a comment from a discussion about this:

      Though [we] have talked about using SingleWriterSynchronizer instead of GlobalCounter for the buffer allocator, to avoid such issues with GlobalCounter usability. The use case driving that notion is the arena allocator and the CHeap allocator, which currently use ThreadCritical. And can't use GlobalCounter because they need to work too early in VM init"

      Another option is to make GlobalCounter itself shutdown-safe (or even init safe).

            Unassigned Unassigned
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: