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

Mutex rank ordering problem JVMTI LoadedClassesClosure and G1 SATB queue

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      A user reported a mutex rank ordering problem between JVMTI LoadedClassesClosure and G1's SATB queues. As far as I can tell, this is caused by JDK-8187577:

      ClassLoaderData::loaded_classes_do() acquires the "Metaspace allocation lock/5" and LoadedClassesClosure tries to enqueue it into G1's SATB queue, thus attempts to acquire "SATB_Q_CBL_mon/16"

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/home/buildbot/worker/jdk8u-redhat-linux/build/hotspot/src/share/vm/runtime/mutex.cpp:1321), pid=52148, tid=0x00007f270fd93700
      # fatal error: acquiring lock SATB_Q_CBL_mon/16 out of order with lock Metaspace allocation lock/5 -- possible deadlock
      #
      # JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-builds.shipilev.net-openjdk-jdk8-redhat-fastdebug-b113-20191111-aarch64-shenandoah-jdk8u232-b09)
      # Java VM: OpenJDK 64-Bit Server VM (25.71-b113-20191111-aarch64-shenandoah-jdk8u232-09-fastdebug mixed mode linux-amd64 compressed oops)
      # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #

      --------------- T H R E A D ---------------

      Current thread (0x00007f270805d800): JavaThread "main" [_thread_in_vm, id=52149, stack(0x00007f270fc93000,0x00007f270fd94000)]

      Stack: [0x00007f270fc93000,0x00007f270fd94000], sp=0x00007f270fd8b770, free space=993k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1235370] VMError::report_and_die()+0x160
      V [libjvm.so+0x79c14f] report_fatal(char const*, int, char const*)+0x6f
      V [libjvm.so+0xe03c57] Monitor::set_owner_implementation(Thread*)+0x227
      V [libjvm.so+0xf63f95] PtrQueueSet::enqueue_complete_buffer(void**, unsigned long)+0x25
      V [libjvm.so+0xf64268] PtrQueueSet::process_or_enqueue_complete_buffer(void**)+0x78
      V [libjvm.so+0xf646d5] PtrQueue::enqueue_known_active(void*)+0x265
      V [libjvm.so+0x9036b6] G1SATBCardTableModRefBS::enqueue(oop)+0x166
      V [libjvm.so+0xc353d2] LoadedClassesClosure::do_klass(Klass*)+0x102
      V [libjvm.so+0x693955] ClassLoaderData::loaded_classes_do(KlassClosure*)+0x55
      V [libjvm.so+0x69528b] ClassLoaderDataGraph::loaded_classes_do(KlassClosure*)+0x2b
      V [libjvm.so+0xc337b9] JvmtiGetLoadedClasses::getLoadedClasses(JvmtiEnv*, int*, _jclass***)+0xb9
      V [libjvm.so+0xb9e4d7] jvmti_GetLoadedClasses+0x127
      C [libjdwp.so+0xc7a7] classTrack_processUnloads+0x77
      C [libjdwp.so+0x14b6b] event_callback+0x2eb
      C [libjdwp.so+0x158ff] cbClassPrepare+0x7f
      V [libjvm.so+0xc2524a] JvmtiExport::post_class_prepare(JavaThread*, Klass*)+0xea
      V [libjvm.so+0x9f336c] InstanceKlass::link_class_impl(instanceKlassHandle, bool, Thread*) [clone .part.235]+0x6ac
      V [libjvm.so+0x9f33ec] InstanceKlass::link_class_impl(instanceKlassHandle, bool, Thread*)+0x4c
      V [libjvm.so+0x9f4727] InstanceKlass::initialize(Thread*)+0x157
      V [libjvm.so+0xaac066] InterpreterRuntime::_new(JavaThread*, ConstantPool*, int)+0x236

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rkennke Roman Kennke
              Reporter:
              rkennke Roman Kennke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: