RFR: 8229517: Support for optional asynchronous/buffered logging [v8]
Xin Liu
xliu at openjdk.java.net
Fri Apr 23 22:42:24 UTC 2021
On Tue, 30 Mar 2021 06:57:16 GMT, Xin Liu <xliu at openjdk.org> wrote:
>> src/hotspot/share/logging/logAsyncFlusher.hpp line 116:
>>
>>> 114: bool equals(const AsyncLogMessage& o) const {
>>> 115: return (&_output == &o._output) && (_message == o._message || !strcmp(_message, o._message));
>>> 116: }
>>
>> [`strcmp()` is not defined for `NULL`](https://en.cppreference.com/w/cpp/string/byte/strcmp) but you can have `_message == NULL` if you've transferred ownership in the copy constructor.
>
> yes, this is subtle bug! thanks!
> I thought that if _message is NULL, then o._message must be NULL, then it will be true for _message == o._message. I was wrong.
fixed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3135
More information about the hotspot-dev
mailing list