-
Bug
-
Resolution: Unresolved
-
P3
-
None
-
12
-
x86_64
-
windows_10
A DESCRIPTION OF THE PROBLEM :
At java.util.concurrent.ConcurrentHashMap#addCount:2339
i think the condition is if the thread is reach maximum or the new table size is twice as before or the nextTable is null or the transferIndex is lesss than zero; the bug in jdk8 is "https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8214427" , i think the main thing is not one is positive another is negtive, but the new table size is twice as before.
at jdk12 i think is not fix it, "sc == rs + 1" compare the work thread but not array size, i think the code should be
if (sc == rs + MAX_RESIZERS || (sc >>>RESIZE_STAMP_SHIFT) == (rs>>>RESIZE_STAMP_SHIFT) + 1 ||
(nt = nextTable) == null || transferIndex <= 0)
break;
rather than
if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 ||
sc == rs + MAX_RESIZERS || (nt = nextTable) == null ||
transferIndex <= 0)
break;
REGRESSION : Last worked in version 8
FREQUENCY : always
At java.util.concurrent.ConcurrentHashMap#addCount:2339
i think the condition is if the thread is reach maximum or the new table size is twice as before or the nextTable is null or the transferIndex is lesss than zero; the bug in jdk8 is "https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8214427" , i think the main thing is not one is positive another is negtive, but the new table size is twice as before.
at jdk12 i think is not fix it, "sc == rs + 1" compare the work thread but not array size, i think the code should be
if (sc == rs + MAX_RESIZERS || (sc >>>RESIZE_STAMP_SHIFT) == (rs>>>RESIZE_STAMP_SHIFT) + 1 ||
(nt = nextTable) == null || transferIndex <= 0)
break;
rather than
if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 ||
sc == rs + MAX_RESIZERS || (nt = nextTable) == null ||
transferIndex <= 0)
break;
REGRESSION : Last worked in version 8
FREQUENCY : always
- relates to
-
JDK-8214427 probable bug in logic of ConcurrentHashMap.addCount()
- Resolved
-
JDK-8215326 Test java/util/concurrent/ConcurrentHashMap/ToArray.java hangs after j.u.c updates
- Closed