RFR: 8294075: gtest/AsyncLogGtest crashes with SEGV
Xin Liu
xliu at openjdk.org
Wed Sep 21 02:41:12 UTC 2022
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.
-------------
Commit messages:
- 8294075: gtest/AsyncLogGtest crashes with SEGV
Changes: https://git.openjdk.org/jdk/pull/10367/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10367&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8294075
Stats: 9 lines in 1 file changed: 4 ins; 0 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/10367.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10367/head:pull/10367
PR: https://git.openjdk.org/jdk/pull/10367
More information about the hotspot-runtime-dev
mailing list