RFR: JDK-8285712: LogMessageBuffer doesn't check vsnprintf return value [v2]

David Holmes dholmes at openjdk.java.net
Fri Apr 29 00:42:07 UTC 2022


On Thu, 28 Apr 2022 08:08:42 GMT, Johan Sjölén <duke at openjdk.java.net> wrote:

>> os::vsnprintf can return a negative value on encoding error. A negative return value will cause wraparound when cast to size_t. This in turn causes LogMessageBuffer::grow() to attempt a large memory allocation. Instead of accepting this we bail on the logging.
>
> Johan Sjölén has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Move va_end to avoid duplication

Fix is good - thanks.

This does make me wonder what the logging code should actually do when there are low-level I/O errors. At the moment the API pretends it can never fail.

David

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8423


More information about the hotspot-runtime-dev mailing list