RFR: 8294075: gtest/AsyncLogGtest crashes with SEGV
David Holmes
dholmes at openjdk.org
Wed Sep 21 07:02:58 UTC 2022
On Wed, 21 Sep 2022 02:34:03 GMT, Xin Liu <xliu 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.
-------------
Marked as reviewed by dholmes (Reviewer).
PR: https://git.openjdk.org/jdk/pull/10367
More information about the hotspot-runtime-dev
mailing list