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

CDS check_excluded_classes needs DumpTimeTable_lock

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b03

      Backports

        Description

        Today we call SystemDictionaryShared::check_excluded_classes() before holding the DumpTimeTable_lock:

        https://github.com/openjdk/jdk/blob/0b09129faefb945c2f2c35dab2731961216d054e/src/hotspot/share/cds/metaspaceShared.cpp#L490

          SystemDictionaryShared::check_excluded_classes();
          MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);

        It's possible for concurrent class unloading to modify the dumptime table where SystemDictionaryShared::remove_dumptime_info is called from here:

         0 InstanceKlass::unload_class
         1 ClassLoaderData::classes_do
         2 ClassLoaderData::unload
         3 ClassLoaderDataGraph::do_unloading
         4 SystemDictionary::do_unloading
         5 ZUnload::unlink
         6 ZHeap::process_non_strong_references
         7 ZDriver::concurrent_process_non_strong_references
         8 ZDriver::gc
         9 ZDriver::run_service
        10 ConcurrentGCThread::run

        Fix: the above two source lines should be swapped.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                iklam Ioi Lam
                Reporter:
                iklam Ioi Lam
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: