[jdk17u-dev] Integrated: 8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool

Dmitry Chuyko dchuyko at openjdk.org
Fri Jun 27 17:55:55 UTC 2025


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

> This a backport of JDK-8351933 [0] (PR [1]) for 17u. At one of code paths the TC subfield of ctl field is decremented and the result is not masked correctly. As a result, the FJP may stop executing tasks [2]. The target code is in awaitWork() instead of tryTrim() 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 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
> [2] https://bugs.openjdk.org/browse/JDK-8330017

This pull request has now been integrated.

Changeset: a897ee8c
Author:    Dmitry Chuyko <dchuyko at openjdk.org>
Committer: Paul Hohensee <phh at openjdk.org>
URL:       https://git.openjdk.org/jdk17u-dev/commit/a897ee8cb0602d374d6bcbe7c28bf5d38b804e8b
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool

Reviewed-by: phh, dl

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

PR: https://git.openjdk.org/jdk17u-dev/pull/3354


More information about the jdk-updates-dev mailing list