RFR: 8261921: ClassListParser::current should be used only by main thread [v2]
David Holmes
dholmes at openjdk.java.net
Tue Feb 23 00:48:43 UTC 2021
On Mon, 22 Feb 2021 23:59:00 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> During -Xshare:dump, ClassListParser::current() should be used only by the main thread, which has created the only ClassListParser instance. Accessing it from other threads could cause intermittent failures. We observed this only on certain hosts with -Xcomp.
>>
>> The fix is to check for `ClassListParser::is_parsing_thread()` before calling `ClassListParser::current()`. After the fix, I can no longer reproduce the crash.
>>
>> I also did some renaming and comment cleaning.
>
> Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>
> - Merge branch 'master' of https://github.com/openjdk/jdk into 8261921-classlistparser-only-main-thread
> - changed _parsing_thread to volatile
> - 8261921: ClassListParser::current should be used only by main thread
Still good.
Thanks,
David
src/hotspot/share/classfile/classListParser.cpp line 84:
> 82:
> 83: bool ClassListParser::is_parsing_thread() {
> 84: return (Atomic::load(&_parsing_thread) == Thread::current());
Nit: superfluous brackets on a binary operator
-------------
Marked as reviewed by dholmes (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2619
More information about the hotspot-runtime-dev
mailing list