RFR(xs): 8153845: UL log write method missing essential assert

Robbin Ehn robbin.ehn at oracle.com
Fri Apr 8 12:24:15 UTC 2016


Hi Bengt,

On 04/08/2016 02:16 PM, Bengt Rutisson wrote:
>
> Hi Robbin,
>
> On 2016-04-08 14:19, Marcus Larsson wrote:
>> Hi Robbin,
>>
>> On 04/08/2016 01:54 PM, Robbin Ehn wrote:
>>>
>>> Hi all,
>>>
>>> Please review,
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8153845
>>>
>>> Tested with jprt.
>>>
>>> diff -r 35cb720769c5 src/share/vm/logging/logTagSet.cpp
>>> --- a/src/share/vm/logging/logTagSet.cpp    Fri Apr 08 08:51:45 2016
>>> +0200
>>> +++ b/src/share/vm/logging/logTagSet.cpp    Fri Apr 08 13:39:12 2016
>>> +0200
>>> @@ -98,6 +98,7 @@
>>>  const size_t vwrite_buffer_size = 512;
>>>
>>>  void LogTagSet::vwrite(LogLevelType level, const char* fmt, va_list
>>> args) {
>>> +  assert(level >= LogLevel::Off && level < LogLevel::Count, "Log
>>> level is incorrect");
>>>    char buf[vwrite_buffer_size];
>>>    va_list saved_args;           // For re-format on buf overflow.
>>>    va_copy(saved_args, args);
>>>
>>>
>>
>> Can we make the assert check "level >= LogLevel::First && level <=
>> LogLevel::Last" instead?
>
> And can we make the error message include the actual value of "level" so
> we know why the assert failed?
>

Yes, no problem.

Thanks!

/Robbin

> Thanks,
> Bengt
>
>>
>> Thanks,
>> Marcus
>>
>>>
>>> Thanks!
>>>
>>> /Robbin
>>
>


More information about the hotspot-runtime-dev mailing list