--- old/src/hotspot/share/prims/jvmtiEnvBase.cpp 2019-11-04 14:57:29.000000000 -0500 +++ new/src/hotspot/share/prims/jvmtiEnvBase.cpp 2019-11-04 14:57:28.000000000 -0500 @@ -654,10 +654,11 @@ java_thread->is_thread_fully_suspended(false, &debug_bits)), "at safepoint or target thread is suspended"); oop obj = NULL; - ObjectMonitor *mon = java_thread->current_waiting_monitor(); + ObjectMonitorHandle omh; + ObjectMonitor *mon = java_thread->current_waiting_monitor(&omh); if (mon == NULL) { // thread is not doing an Object.wait() call - mon = java_thread->current_pending_monitor(); + mon = java_thread->current_pending_monitor(&omh); if (mon != NULL) { // The thread is trying to enter() an ObjectMonitor. obj = (oop)mon->object(); @@ -733,16 +734,18 @@ HandleMark hm; oop wait_obj = NULL; { + ObjectMonitorHandle omh; // save object of current wait() call (if any) for later comparison - ObjectMonitor *mon = java_thread->current_waiting_monitor(); + ObjectMonitor *mon = java_thread->current_waiting_monitor(&omh); if (mon != NULL) { wait_obj = (oop)mon->object(); } } oop pending_obj = NULL; { + ObjectMonitorHandle omh; // save object of current enter() call (if any) for later comparison - ObjectMonitor *mon = java_thread->current_pending_monitor(); + ObjectMonitor *mon = java_thread->current_pending_monitor(&omh); if (mon != NULL) { pending_obj = (oop)mon->object(); }