JDK-8253833 : mutexLocker assert_locked_or_safepoint should not access VMThread state from non-VM-thread
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-09-30
  • Updated: 2020-10-15
  • Resolved: 2020-10-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b20Fixed
Related Reports
Relates :  
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.
Comments
Changeset: 45b09a3f Author: Robbin Ehn <rehn@openjdk.org> Date: 2020-10-12 06:01:31 +0000 URL: https://git.openjdk.java.net/jdk/commit/45b09a3f
12-10-2020

ILW = MMM = P3
06-10-2020