RFR: 8305819: LogConfigurationTest intermittently fails on AArch64

Johan Sjölen jsjolen at openjdk.org
Wed Apr 26 10:50:23 UTC 2023


On Tue, 25 Apr 2023 08:30:39 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> LogConfigurationTest*reconfigure*MT* crash intermittently on AArch64.
>> According to the crash log and coredump, we found it crash as follows:
>> 
>> void LogTagSet::log(LogLevelType level, const char* msg) {
>>   LogOutputList::Iterator it = _output_list.iterator(level);
>>   LogDecorations decorations(level, *this, _decorators);
>> 
>>   for (; it != _output_list.end(); it++) {
>>     (*it)->write(decorations, msg);//crash 
>>   }
>> }
>> 
>> In the test, two threads write into the log while another thread dynamically changes the decorators and tags. During this time, the  _output_list will be modified. Because of the relax memory model of aarch64, while adding LogOutputNode to LogOutputList, adding node to list and setting the value of node may be reordered, therefore the read thread may not read the correct value of the node's content. Consequently, storestore memory barrier is needed to ensure the order of writing. 
>> By the way, applying this patch may affect performance.
>> 
>> How to reproduce on Linux aarch64:
>> test case
>> 
>> /* @test
>>  * @library /test/lib
>>  * @modules java.base/jdk.internal.misc
>>  *          java.xml
>>  * @run main/native GTestWrapper --gtest_filter=LogConfigurationTest*reconfigure*MT*
>>  */
>> 
>> Crash may occasionally occur after running continuously for 5000 times.
>
> Marked as reviewed by aph (Reviewer).

Thank you @theRealAph for the in-depth review of this.

>It don't look to me like this is the only data race in LogOutputList. In my opinion, the whole thing really needs more analysis. I think we'd find more bugs.

I agree.


@gaogao-mem, I'll run this through our test suite and assuming everything looks OK I'll give you the thumbs up. You'll also need a sponsor, which I think Andrew will be OK with being.

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

PR Comment: https://git.openjdk.org/jdk/pull/13421#issuecomment-1523193738


More information about the hotspot-runtime-dev mailing list