RFR: 8339159: api/java_rmi/Naming/Rebind.html crashes with SEGV from UTF8::quoted_ascii_length call [v2]
Axel Boldt-Christmas
aboldtch at openjdk.org
Wed Sep 11 07:37:06 UTC 2024
On Wed, 11 Sep 2024 06:32:46 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> The current patch always prints `<unavailable>` in debug builds (where ZapResourceArea is true by default), so it's rather useless.
>>
>> Since the value of the symbol has just been printed a few lines before we free it, shouldn't we just do this?
>>
>>
>> if (!SymbolTable::arena()->Afree(memory, alloc_size)) {
>> log_trace(symboltable)("Leaked permanent symbol");
>> }
>>
>>
>> If you worry about concurrent frees that may make it difficult to see which symbol is leaked (I don't know if this can happen or not), you can print the address of the symbol in both logs.
>
> I was thinking I was allowing this to log in product builds and completely overlooked the fact the helper does nothing in product builds. :( As @iklam notes we print the symbol before the free anyway, so we don't need to print after. Further this code executes within the `SymbolArena_lock` so concurrent frees are not an issue.
>
> Thanks for your suggestions @xmas92 but I think I will go with @iklam 's simpler approach. There are obviously a lot of ways to side-step this particular issue.
Removing it is my preferred solution as well.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20865#discussion_r1753410053
More information about the hotspot-runtime-dev
mailing list