RFR: 8365526: Crash with null Symbol passed to SystemDictionary::resolve_or_null [v5]

Coleen Phillimore coleenp at openjdk.org
Wed Nov 26 13:23:58 UTC 2025


On Wed, 26 Nov 2025 13:19:30 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> How does it leak - it originates from a stringStream that will go out of scope???
>
> Both of the callers in InstanceKlass::nest_host() add the error from a C heap allocated string:
> 
> 
>         const char* msg = ss.as_string(true /* on C-heap */);
>         constantPoolHandle cph(THREAD, constants());
>         SystemDictionary::add_nest_host_error(cph, _nest_host_index, msg);

Ioi and Johan noticed this and Johan has a further improvement to ResourceAllocate the string so that if we don't add it, it will get freed, but that's not the case with the caller today.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28438#discussion_r2564989567


More information about the hotspot-runtime-dev mailing list