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

Generational ZGC: Deadlock after OopMap rewrites in 8331572

XMLWordPrintable

    • gc
    • b04

        In one of our internal tests we have found this deadlock:

        0) Various threads are waiting for the GC to hand out freed memory.

        1) The GC is blocked on the Service_lock:

          Mutex::lock_without_safepoint_check()
          OopMapCache::trigger_cleanup()
          ZGenerationYoung::pause_relocate_start()
          ZGenerationYoung::collect(ZYoungType, ConcurrentGCTimer*)
          ZDriverMinor::gc(ZDriverRequest const&)
          ZThread::run_service()

        2) The Service_lock is held by the ServiceThread, which is stalling because it is waiting for the GC to give it memory

          PlatformMonitor::wait(unsigned long)
          ZRelocateQueue::add_and_wait(ZForwarding*)
          ZRelocate::relocate_object(ZForwarding*, zaddress_unsafe)
          ZUncoloredRootProcessWeakOopClosure::do_root(zaddress_unsafe*)
          ZNMethod::nmethod_oops_do_inner(nmethod*, OopClosure*)
          ZBarrierSetNMethod::nmethod_entry_barrier(nmethod*)
          JvmtiDeferredEventQueue::oops_do(OopClosure*, NMethodClosure*)
          // vvv Lock taken in this frame vvv
          ServiceThread::oops_do_no_frames(OopClosure*, NMethodClosure*)
          ZStackWatermark::process_head(void*)
          ZStackWatermark::start_processing_impl(void*)
          StackWatermark::start_processing()
          StackWatermark::on_safepoint()
          SafepointMechanism::process(JavaThread*, bool, bool)
          StringTable::clean_dead_entries(JavaThread*)
          StringTable::do_concurrent_work(JavaThread*)
          ServiceThread::service_thread_entry

              shade Aleksey Shipilev
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: