RFR: 8365407: Race condition in MethodTrainingData::verify() [v8]

Vladimir Ivanov vlivanov at openjdk.org
Tue Sep 2 16:00:48 UTC 2025


On Tue, 26 Aug 2025 22:59:54 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

>> This change fixes multiple issue with training data verification. While the current state of things in the mainline will not cause  any issues (because of the absence of the call to `TD::verify()` during the shutdown) it does problems in the leyden repo. This change strengthens verification in the mainline (by adding the shutdown verify call), and fixes the problems that prevent  it from working reliably.
>
> 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?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26866#discussion_r2316527758


More information about the hotspot-dev mailing list