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

Compiler calls Dependencies::find_finalizable_subclass without Compile_lock

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 16
    • 16
    • hotspot

      ciInstanceKlass::has_finalizable_subclass() seems to be buggy. It should hold the Compile_lock, because Dependencies::find_finalizable_subclass walks Klass::_next_sibling, which is protected by Compile_lock

      https://github.com/openjdk/jdk/blob/d8d91977127405c4c632add48f2bb310ad60c93c/src/hotspot/share/ci/ciInstanceKlass.cpp#L397

      bool ciInstanceKlass::has_finalizable_subclass() {
        if (!is_loaded()) return true;
        VM_ENTRY_MARK;
        return Dependencies::find_finalizable_subclass(get_instanceKlass()) != NULL;
      }

      https://github.com/openjdk/jdk/blob/d8d91977127405c4c632add48f2bb310ad60c93c/src/hotspot/share/code/dependencies.cpp#L1536

      Klass* Dependencies::find_finalizable_subclass(Klass* k) {
        if (k->is_interface()) return NULL;
        if (k->has_finalizer()) return k;
        k = k->subklass();
        while (k != NULL) {
          Klass* result = find_finalizable_subclass(k);
          if (result != NULL) return result;
          k = k->next_sibling();
        }
        return NULL;
      }

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: