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

mutexLocker assert_locked_or_safepoint should not access VMThread state from non-VM-thread

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b20

      Description

      See here:

      void assert_locked_or_safepoint(const Mutex* lock) {
        // check if this thread owns the lock (common case)
        assert(lock != NULL, "Need non-NULL lock");
        if (lock->owned_by_self()) return;
        if (SafepointSynchronize::is_at_safepoint()) return;
        if (!Universe::is_fully_initialized()) return;
        // see if invoker of VM operation owns it
        VM_Operation* op = VMThread::vm_operation();
        if (op != NULL && op->calling_thread() == lock->owner()) return;
        fatal("must own lock %s", lock->name());
      }

      The call to VMThread::vm_operation() does not check if the calling thread is VMThread. This would fail the assert after JDK-8212107.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rehn Robbin Ehn
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: