[jdk11u-dev] RFR: 8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool

Paul Hohensee phh at openjdk.org
Fri Mar 14 18:35:12 UTC 2025


On Thu, 13 Mar 2025 14:57:19 GMT, Dmitry Chuyko <dchuyko at openjdk.org> wrote:

> This a backport of JDK-8351933 [0] (PR [1]) for 11u. At one of code paths the TC subfield of ctl field is decremented and the result is not masked correctly. The target code is in runWorker() instead of tryTrim()/awaitWork() and the surrounding code is different from the current master, as well as the original mask name. The core change is the same, candidate for CTL.compareAndSet is constructed using '(RC_MASK & c) | (TC_MASK & (c - TC_UNIT))' 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

Marked as reviewed by phh (Reviewer).

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

PR Review: https://git.openjdk.org/jdk11u-dev/pull/3012#pullrequestreview-2686386270


More information about the jdk-updates-dev mailing list