[jdk17u-dev] RFR: 8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool [v3]
Dmitry Chuyko
dchuyko at openjdk.org
Tue Jun 24 11:12:25 UTC 2025
> 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
Dmitry Chuyko has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
- Merge branch 'openjdk:master' into JDK-8351935
- Merge branch 'openjdk:master' into JDK-8351935
- RC_MASK and TC_MASK instead of UC_MASK
-------------
Changes:
- all: https://git.openjdk.org/jdk17u-dev/pull/3354/files
- new: https://git.openjdk.org/jdk17u-dev/pull/3354/files/7fbe301f..09d4316d
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3354&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3354&range=01-02
Stats: 3844 lines in 274 files changed: 724 ins; 2583 del; 537 mod
Patch: https://git.openjdk.org/jdk17u-dev/pull/3354.diff
Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/3354/head:pull/3354
PR: https://git.openjdk.org/jdk17u-dev/pull/3354
More information about the jdk-updates-dev
mailing list