[jdk8u-dev] RFR: 8205399: Set node color on pinned HashMap.TreeNode deletion [v2]

Aleksey Shipilev shade at openjdk.org
Fri Jul 7 09:48:03 UTC 2023


> See the issue for details. It reproduces in 8u, which breaks applications that run with `-ea -esa` for extra safety. We have seen at least two in-production bug reports due to this.
> 
> The backport is not clean, because the test should reside in the different folder.
> 
> The verification barfs on discovering the red root, when it also discovers left/right child node is also red. This technically violates one of the basic properties of RB trees: a red node should not have red children. We can always change (sub-)root node color from red to black without violating RB properties, as the path to any descendant node would still have the same number of black nodes. AFAIU, leaving the (sub-)root red and the child red could potentially break something else. This is why I believe this backport is required and safe for 8u.
> 
> Additional testing:
>  - [x] Linux x86_64, new regression test fails without the patch, passes with it
>  - [x] Linux x86_64 `jdk_util`
>  - [x] Linux x86_64 fastdebug `tier1` (some intermittent failures, which look unrelated and present in current master)

Aleksey Shipilev 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 two additional commits since the last revision:

 - Merge branch 'master' into JDK-8205399-hashmap-node
 - Backport 51d0a9e1223f218d10f8761e38cd2dd478607040

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

Changes:
  - all: https://git.openjdk.org/jdk8u-dev/pull/325/files
  - new: https://git.openjdk.org/jdk8u-dev/pull/325/files/78a88f3a..cf1a17d6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=325&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=325&range=00-01

  Stats: 853 lines in 21 files changed: 389 ins; 317 del; 147 mod
  Patch: https://git.openjdk.org/jdk8u-dev/pull/325.diff
  Fetch: git fetch https://git.openjdk.org/jdk8u-dev.git pull/325/head:pull/325

PR: https://git.openjdk.org/jdk8u-dev/pull/325


More information about the jdk8u-dev mailing list