RFR: 8267926: AsyncLogGtest.java fails on assert with: decorator was not part of the decorator set specified at creation.

Xin Liu xliu at openjdk.java.net
Fri May 28 22:39:23 UTC 2021


On Fri, 28 May 2021 22:15:14 GMT, Xin Liu <xliu at openjdk.org> wrote:

> The root cause of the intermittent failure is that _decorators in LogDecorations 
> may be inconsistent with LogOutput::_decorators. It could happen when gtest disables a
> Log output via set_log_config(TestLogFileName, "all=off").
> 
> Since we copy the entire logDecorations, it's reasonable to copy _decorator as well. 
> LogDecorator is a bitmask of uiint. It's even smaller than a reference on LP64 platforms.
> 
> Caveat: this patch doesn't fix the race condition of update_decorators. Theorically,
> it may still cause an error if user dynamically enrich decorators for one log output. 
> User can't do that via dcmd VM.log because one can't change the configuration of 
> an established output via dcmd.

Test: 
I simulate the race condition in the JBS. it should work.

I personally inspect all gtests, only this line make _decorators bigger than before. 
We haven't added async logging support for stdout/stderr yet. Therefore, it's safe, so far. 


./logging/test_logConfiguration.cpp:222:  set_log_config("stderr", "all=off", _all_decorators);


I will consider this case when I enable stdout/stderr of async logging.

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

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


More information about the hotspot-runtime-dev mailing list