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

CDSProtectionDomain::get_shared_protection_domain should check for exception

XMLWordPrintable

    • b22

        This bug was found when diagnosing JDK-8316131

        Handle CDSProtectionDomain::get_shared_protection_domain(Handle class_loader,
                                                                    int shared_path_index,
                                                                    Handle url,
                                                                    TRAPS) {
          Handle protection_domain;
          if (shared_protection_domain(shared_path_index) == nullptr) {
            Handle pd = get_protection_domain_from_classloader(class_loader, url, THREAD); <<<<< HERE
            atomic_set_shared_protection_domain(shared_path_index, pd());
          }

          // Acquire from the cache because if another thread beats the current one to
          // set the shared protection_domain and the atomic_set fails, the current thread
          // needs to get the updated protection_domain from the cache.
          protection_domain = Handle(THREAD, shared_protection_domain(shared_path_index));
          assert(protection_domain.not_null(), "sanity"); <<<<< HERE
          return protection_domain;
        }

        When we are really low on heap memory, the get_protection_domain_from_classloader() call may fail. Instead of THREAD, we should pass CHECK so that the exception is propagated properly.

              ccheung Calvin Cheung
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: