RFR: 8328880: Events::log_exception should limit the size of the logging message
Vladimir Kozlov
kvn at openjdk.org
Fri Aug 23 02:04:03 UTC 2024
On Fri, 23 Aug 2024 01:30:19 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> src/hotspot/share/utilities/events.cpp line 169:
>>
>>> 167: h_exception->print_value_on(&st);
>>> 168: if (message != nullptr) {
>>> 169: int len = message_length_limit > 0 ? message_length_limit : (int)strlen(message);
>>
>> Do we need to check that `message_length_limit <= (int)strlen(message)`?
>> Or it is intentional to reserve bigger space in output than `message`?
>
> I don't quite understand the question. We are specifying the maximum number of characters to print: it is either `message_length_limit` if that is > 0 otherwise it is no limit i.e. the whole string i.e. `strlen(message)`.
Someone can pass `message_length_limit` which is > strlen(message). What happens in this case?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20638#discussion_r1728142135
More information about the hotspot-dev
mailing list