RFR: 8365407: Race condition in MethodTrainingData::verify() [v8]
Igor Veresov
iveresov at openjdk.org
Tue Sep 2 16:19:44 UTC 2025
On Tue, 2 Sep 2025 15:57:42 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> Igor Veresov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Relax verification invariant
>
> src/hotspot/share/oops/trainingData.cpp line 635:
>
>> 633: int init_deps_left2 = compute_init_deps_left();
>> 634:
>> 635: bool invariant = (init_deps_left1 >= init_deps_left2);
>
> I assume this check takes concurrent class initialization into account and init notification events are processed on a dedicated thread. Can we strengthen the check by repeatedly performing it and ensuring the value converges? Also, maybe take event queue into account?
It's very hard to do reliably given the way the vm shutdown currently works. There is no way to ensure that all the java threads are stopped, so checking the convergence is problematic. So, the best I can do right now is prove the `>=` property.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26866#discussion_r2316575038
More information about the hotspot-dev
mailing list