RFR (S) 8218593: Symbol leak in prepend_host_package_name

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Mon Feb 11 16:30:14 UTC 2019



On 2/9/19 11:37 PM, Kim Barrett wrote:
>> 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.
>
> ------------------------------------------------------------------------------
So I was trying to wrap the refcounting in this method so that it's 
harder to get wrong, but I guess that didn't work.

I've already pushed this so I'm going to backout this change and start over.

Thanks,
Coleen


More information about the hotspot-runtime-dev mailing list