[jdk21u-dev] RFR: 8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool
duke
duke at openjdk.org
Tue Apr 15 18:06:57 UTC 2025
On Thu, 13 Mar 2025 14:31:42 GMT, Dmitry Chuyko <dchuyko at openjdk.org> wrote:
> This a backport of JDK-8351933 [0] (PR [1]) for 21u. At one of code paths the TC subfield of ctl field is decremented and the result is not masked correctly. The target code is also in tryTrim() but the surrounding is different from the current master, as well as the original mask name. The core change is the same, candidate for compareAndSetCtl() is constructed using '(c & RC_MASK) | ((c - TC_UNIT) & TC_MASK)' instead of '(UC_MASK & (c - TC_UNIT))' to correctly preserve the RC subfield.
>
> [0] https://bugs.openjdk.org/browse/JDK-8351933
> [1] https://github.com/openjdk/jdk/pull/24034
@dchuyko
Your change (at version 2639b37e93c0aeff967a0468506c8605c6ef1138) is now ready to be sponsored by a Committer.
-------------
PR Comment: https://git.openjdk.org/jdk21u-dev/pull/1485#issuecomment-2807054376
More information about the jdk-updates-dev
mailing list