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

SymbolPropertyTable creates an extra OopHandle per entry

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b08

      Description

        SymbolPropertyEntry* new_entry(unsigned int hash, Symbol* symbol, intptr_t symbol_mode) {
          SymbolPropertyEntry* entry = (SymbolPropertyEntry*) Hashtable<Symbol*, mtSymbol>::new_entry(hash, symbol);
          // Hashtable with Symbol* literal must increment and decrement refcount.
          symbol->increment_refcount();
          entry->set_symbol_mode(symbol_mode);
          entry->set_method(NULL);
          entry->set_method_type(NULL);
          return entry;
        }

      Since the SymbolPropertyEntry constructor isn't called, the fields need to be explicitly zeroed.

      void SymbolPropertyEntry::set_method_type(oop p) {
        _method_type = OopHandle(OopStorageSet::vm_global(), p);
      }

      set_method_type creates a new OopHandle for NULL. There's an test when it's called in SystemDictionary that the value of the oop is NULL but not that the entry is_empty(), so there we call this again and create another OopHandle.

      I found this because I also added an assert to the assignment operator to prevent leaking OopHandles. This was [~eosterlund] 's idea from reviewing JDK-8249768 (which doesn't leak OopHandles).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              coleenp Coleen Phillimore
              Reporter:
              coleenp Coleen Phillimore
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: