RFR: 8359120: Improve warning message when fail to load hsdis library [v2]

Manuel Hässig mhaessig at openjdk.org
Mon Jun 23 12:16:37 UTC 2025


On Mon, 23 Jun 2025 12:02:09 GMT, Taizo Kurashige <tkurashige at openjdk.org> wrote:

>> src/hotspot/share/code/nmethod.cpp line 3493:
>> 
>>> 3491:     st->bol();
>>> 3492:     st->cr();
>>> 3493:     st->print_cr("Loading hsdis library failed, so undisassembled code is printed in the below [MachCode] section");
>> 
>> Some comments on the message:
>>  - I don't think we should use `[MachCode]` inside the square brackets apart from marking the start of a section. Otherwise, tools parsing a hs_err file incorrectly identify the start of the MachCode section.
>>  - Personally, I find the language of the message a bit clunky. Here are a few suggestions I would personally prefer:
>>    `Loading hsdis library failed, unable to show disassembled code in MachCode section` or `Note: Unable to display disassembled code because loading of hsdis library failed.`.
>
>> I don't think we should use [MachCode]
> 
> You're right. I will stop using `[MachCode]`.
> 
>> Here are a few suggestions I would personally prefer:
> 
> Thank you for your suggestion.
> I prefer the former expression.
> However, if hsdis is loaded successfully, the disassembled code will appear in `[Disassembly]` instead of `[MachCode]`, so I don't think "unable to show disassembled code in MachCode section" is appropriate.
> Do you think "undisassembled" is clunky? "undisassembled" is also used in [src/hotspot/share/code/nmethod.cpp#L3428](https://github.com/openjdk/jdk/blob/c220b1358c91bce2eb7515e9f600004c7b975ee6/src/hotspot/share/code/nmethod.cpp#L3428), so I don't think it's too clunky. 
> So, for example, how about `Loading hsdis library failed, undisassembled code is shown in MachCode section`? If "undisassembled" is clunky, I think it could be "not disassembled" for example.

I do happen to dislike "undisassembled", but I was not aware of its usage in other places in the codebase. I'm fine with the message now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25726#discussion_r2161473437


More information about the hotspot-compiler-dev mailing list