RFR (S) 8218593: Symbol leak in prepend_host_package_name

Kim Barrett kim.barrett at oracle.com
Sun Feb 10 04:37:53 UTC 2019


> On Feb 7, 2019, at 6:45 PM, coleen.phillimore at oracle.com wrote:
> 
> Summary: add appropriate refcounting for Symbols stomped by parsing
> 
> open webrev at http://cr.openjdk.java.net/~coleenp/2019/8218593.01/webrev
> bug link https://bugs.openjdk.java.net/browse/JDK-8218593
> 
> Tested with runThese and verifying symboltable logging shows similar numbers of symbols unloaded.   Ran tests added for the change which added the function prepend_host_package_name().  Also ran tier1-3.
> 
> Thanks,
> Coleen

------------------------------------------------------------------------------ 
src/hotspot/share/classfile/classFileParser.cpp

5778     Symbol* new_name = SymbolTable::new_symbol(new_anon_name,
5779                                           (int)host_pkg_len + 1 + class_name_len,
5780                                           CHECK);
5781     update_class_name(new_name);

I think calling update_class_name here is not right.  new_symbol
returns a Symbol with an incremented refcount.  update_class_name will
increment it again.  The destructor change will decrement it, but only
once (of course).  So it picked up an extra count in the process.

------------------------------------------------------------------------------


More information about the hotspot-runtime-dev mailing list