RFR: 8372988: Test runtime/Nestmates/membership/TestNestHostErrorWithMultiThread.java failed: Unexpected interrupt [v2]
Ioi Lam
iklam at openjdk.org
Mon Dec 15 20:52:31 UTC 2025
On Mon, 15 Dec 2025 20:41:01 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> In the fix for JDK-8365526 we changed the `set_nest_host_error` code so that we would overwrite the message in the resolution error table, and free the previous copy of the message (the messages will always be the same). This was the wrong thing to do as the message could be in-use at the time it was freed, leading to either a missing message, or an assertion failure when we checked the messages for UTF8 validity.
>>
>> The fix is to simply only ever set the message once (freeing it only when the entry is removed from the table).
>>
>> Testing:
>> - TestNestHostErrorWithMultiThread.java with an augmented VM that inserts a delay that helped trigger the bug
>> - tiers 1-3 sanity
>>
>> Thanks
>
> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>
> Avoid memory leaks by passing stringStream
Looks good. Two minor nits.
src/hotspot/share/classfile/resolutionErrors.cpp line 130:
> 128:
> 129: void ResolutionErrorEntry::set_nest_host_error(const char* message) {
> 130: assert(_nest_host_error == nullptr, "caller should have checked");
May also check that you're holding `SystemDictionary_lock`? That way you're more certain that the field has not been changed since the caller checked it.
src/hotspot/share/classfile/systemDictionary.cpp line 1881:
> 1879: entry->set_nest_host_error(message.as_string(true /* on C-heap */));
> 1880: }
> 1881: else {
`} else {` should be in one line.
-------------
Marked as reviewed by iklam (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28817#pullrequestreview-3580099164
PR Review Comment: https://git.openjdk.org/jdk/pull/28817#discussion_r2620803907
PR Review Comment: https://git.openjdk.org/jdk/pull/28817#discussion_r2620805362
More information about the hotspot-runtime-dev
mailing list