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

Aleksey Shipilev shade at openjdk.org
Fri Jul 7 13:24:13 UTC 2023


On Tue, 30 May 2023 08:42:32 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> 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)

This pull request has now been integrated.

Changeset: a2a68737
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk8u-dev/commit/a2a68737d927e7afa6e5c2d2642d8cb42f9d6be9
Stats:     176 lines in 2 files changed: 175 ins; 0 del; 1 mod

8205399: Set node color on pinned HashMap.TreeNode deletion

Backport-of: 51d0a9e1223f218d10f8761e38cd2dd478607040

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

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


More information about the jdk8u-dev mailing list