RFR: 8328880: Events::log_exception should limit the size of the logging message
David Holmes
dholmes at openjdk.org
Fri Aug 23 02:27:08 UTC 2024
On Fri, 23 Aug 2024 02:01:47 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> 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?
Printing stops at the end of `message`. Given this:
const char* msg = "This is the message";
printf(">>%.*s<<\n", 40, msg);
we get:
>>This is the message<<
Having a limit >> strlen(message) is the normal expected case.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20638#discussion_r1728160978
More information about the hotspot-dev
mailing list