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

Aleksey Shipilev shade at openjdk.org
Tue May 30 11:03:31 UTC 2023


See the issue for details. It reproduces in 8u, which breaks applications that run with `-ea -esa` for extra safety.

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. But in this case, it seems innocuous anyway, and root can be turned black to avoid the assertion failure. We can always change root node color from red to black without violating RB properties (some authors even claim "root is black" is a property of RB trees). This is why I believe this backport is 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)

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

Commit messages:
 - Backport 51d0a9e1223f218d10f8761e38cd2dd478607040

Changes: https://git.openjdk.org/jdk8u-dev/pull/325/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=325&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8205399
  Stats: 176 lines in 2 files changed: 175 ins; 0 del; 1 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