RFR: 8294075: gtest/AsyncLogGtest crashes with SEGV

Xin Liu xliu at openjdk.org
Thu Sep 22 16:17:19 UTC 2022


On Wed, 21 Sep 2022 10:37:50 GMT, Aleksey Shipilev <shade 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.
>
> Yes, seems reasonable.

hi, @shipilev 

Thank you for reviewing this patch. Is it possible that you start a test for tier1~6? 
My understanding is the infra hits this issue because it may run some tests in single-core container environment.  The the kernel preemption triggers the race condition more likely.  I simulate this using taskset locally. 

I wish we could verify this patch works before checking in.

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

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


More information about the hotspot-runtime-dev mailing list