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

TestUnloadEventClassCount fails with "assert(SafepointSynchronize::is_at_safepoint()) failed: invariant"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 14
    • 14
    • hotspot
    • jfr
    • b25

      It seems JFR is making the incorrect assumption that SystemDictionary::do_unloading() is only ever called in safepoints, and fails with:

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (open/src/hotspot/share/jfr/jni/jfrGetAllEventClasses.cpp:50), pid=13170, tid=13188
      # assert(SafepointSynchronize::is_at_safepoint()) failed: invariant
      #
      # JRE version: Java(TM) SE Runtime Environment (14.0) (fastdebug build 14-internal+0-2019-11-18-0707099.pliden...)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 14-internal+0-2019-11-18-0707099.pliden..., mixed mode, tiered, z gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xdd2ae8] JfrEventClasses::increment_unloaded_event_class()+0x48
      #

      Current thread (0x00007f57740646a0): ConcurrentGCThread "ZDriver" [stack: 0x00007f57780ca000,0x00007f57781ca000] [id=13188]

      Stack: [0x00007f57780ca000,0x00007f57781ca000], sp=0x00007f57781c8680, free space=1017k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xdd2ae8] JfrEventClasses::increment_unloaded_event_class()+0x48
      V [libjvm.so+0xe4dd25] do_unloaded_klass(Klass*)+0xc5
      V [libjvm.so+0x92a426] ClassLoaderData::classes_do(void (*)(Klass*))+0x36
      V [libjvm.so+0x936bb7] ClassLoaderDataGraph::classes_unloading_do(void (*)(Klass*))+0x57
      V [libjvm.so+0xe5379c] JfrTypeSet::serialize(JfrCheckpointWriter*, JfrCheckpointWriter*, bool, bool)+0x1a6c
      V [libjvm.so+0xdb1e4d] JfrCheckpointManager::write_type_set_for_unloaded_classes()+0x6d
      V [libjvm.so+0x160b4c6] SystemDictionary::do_unloading(GCTimer*)+0x216
      V [libjvm.so+0x181cbad] ZUnload::unlink()+0x6d
      V [libjvm.so+0x17cfa28] ZHeap::process_non_strong_references()+0x38
      V [libjvm.so+0x17cc4f0] ZDriver::gc(GCCause::Cause)+0x700
      V [libjvm.so+0x17cd2fb] ZDriver::run_service()+0xcb
      V [libjvm.so+0x9ccddb] ConcurrentGCThread::run()+0x2b
      V [libjvm.so+0x16775c6] Thread::call_run()+0xf6
      V [libjvm.so+0x13a954e] thread_native_entry(Thread*)+0x10e

      To reproduce (with a debug build):

      make test TEST=test/jdk/jdk/jfr/jvm/TestUnloadEventClassCount.java JTREG="VM_OPTIONS=-XX:+UnlockExperimentalVMOptions -XX:+UseZGC"

            mgronlun Markus Grönlund
            pliden Per Liden (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: