[12]RFR 8205399 : Set node color on pinned HashMap.TreeNode deletion (original) (raw)
Brent Christian brent.christian at oracle.com
Wed Aug 8 18:57:22 UTC 2018
- Previous message: [12] RFR 8208542: Add 4 JNDI tests to com/sun/jndi/dns/ListTests/
- Next message: [12]RFR 8205399 : Set node color on pinned HashMap.TreeNode deletion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
Please review the following fix.
Bug: https://bugs.openjdk.java.net/browse/JDK-8205399 Webrev: http://cr.openjdk.java.net/~bchristi/8205399/webrev01/
The vmTestbase/vm/gc/containers/Combination05/TestDescription.java test, which does random adds and removes (via Iterator), has been failing intermittently with an AssertionError.
I tracked down a couple sequences of operations that trigger the assertion. Sufficient HashMap collisions convert a bin to a tree, and then values are deleted using Iterator.remove() (pinned node deletion).
The condition that fails in HashMap.TreeNode.checkInvariants() is:
if (t.red && tl != null && tl.red && tr != null && tr.red)
A red TreeNode should not have two red children.
Many thanks to Doug Lea for providing the fix for the HashMap red/black tree code. The root node color needs to be set in this case.
Thanks, -Brent
- Previous message: [12] RFR 8208542: Add 4 JNDI tests to com/sun/jndi/dns/ListTests/
- Next message: [12]RFR 8205399 : Set node color on pinned HashMap.TreeNode deletion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]