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

Incorrect use of GC_locker::is_active()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: hs25
    • Fix Version/s: hs25
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b52
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        A side effect of the problem in JDK-8013057 is that GC_locker::is_active() is called which fails with:

        "assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint"

        There are two issues here:

        1) This is an incorrect use of GC_locker::is_active(), which can only be called during a safepoint. Both SymbolTable and StringTable makes such calls to make sure the input argument is stable (not on the heap or the heap is locked). Checking that the input "is not in reserved" is enough here since the input should never on the heap.

        2) The actual assert in GC_locker::is_active() is also incorrect in that it checks _needs_gc || at_a_safepoint(). The assert should only check is_at_safepoint(), since _needs_gc can change at any time from true to false outside a safepoint.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  pliden Per Liden
                  Reporter:
                  pliden Per Liden
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: