RFR: 8294075: gtest/AsyncLogGtest crashes with SEGV

Xin Liu xliu at openjdk.org
Wed Sep 21 17:23:13 UTC 2022


On Wed, 21 Sep 2022 06:59:12 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> In order to test "drop messages scenario", I replace the serving buffers with shrunk buffers(1k).
>> This is done by RAII class 'AsyncLogWriter::BufferUpdater'. There is a race condition between test and AsyncLog thread. 
>> The race condition exhibits when AsyncLog thread is still processing `buffer_staging` but test thread deletes it in dtor of BufferUpdater. 
>> 
>> This patch issues AsyncLogWriter::flush() before dtor of BufferUpdater. buffers are reverted only when pending messages have all been handled.
>> 
>> I test TEST="jtreg:hotspot/jtreg/gtest/AsyncLogGtest.java" 100 times and never see race condition.
>
> Based on the explanation of the bug this fix seems reasonable.
> 
> Thanks.

hi, @dholmes-ora, 
Do you want to have a trial run of this patch or we just integrate it?

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

PR: https://git.openjdk.org/jdk/pull/10367


More information about the hotspot-runtime-dev mailing list