-
Bug
-
Resolution: Duplicate
-
P4
-
8, 8u25, 9
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142175 | emb-9 | Doug Lea | P4 | Resolved | Fixed | team |
FULL PRODUCT VERSION :
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
ConcurrentHashMap is stuck in an endless loop in computeIfAbsent - the for-loop starting at line 1649.
tab=[
null,
null,
null,
null,
null,
null,
null,
null,
null=null,
null,
null,
null,
null,
class com.<redacted>.ClipboardPrepareImportService=com.<redacted>.ClipboardPrepareImportService@2ae00cd3,
null,
interface com.<redacted>.BackendConnectionGateway=Mock for BackendConnectionGateway, hashCode: 1117386246]
h=833174808
* the first if (line 1651) is skipped because tab is neither null nor empty
* the second if as well because f = tabAt(....) is equal to null=null (CHM$ReservationNode)
* the third if (line 1670) as well because fh = -3 (RESERVED)
* we fall back into the else block at line 1672
* tabAt(tab, i) == f is true (i=8) at line 1675
* the if at line 1676 is not satisfied because fh = -3
* the if at line 1696 is also not satisfied because f is an CHM$ReservationNode
* binCount = 0 so the if at line 1710 is also not satisfied.
Aaaand back to the beginning of the loop at 1649.
The searched value is not yet present when computeIfPresent is called -> the mapper function should be called but that never happens.
This only happens occasionally.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The mapping function is called and the computed value is added to the map and returned.
ACTUAL -
Endless loop.
REPRODUCIBILITY :
This bug can be reproduced occasionally.
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
ConcurrentHashMap is stuck in an endless loop in computeIfAbsent - the for-loop starting at line 1649.
tab=[
null,
null,
null,
null,
null,
null,
null,
null,
null=null,
null,
null,
null,
null,
class com.<redacted>.ClipboardPrepareImportService=com.<redacted>.ClipboardPrepareImportService@2ae00cd3,
null,
interface com.<redacted>.BackendConnectionGateway=Mock for BackendConnectionGateway, hashCode: 1117386246]
h=833174808
* the first if (line 1651) is skipped because tab is neither null nor empty
* the second if as well because f = tabAt(....) is equal to null=null (CHM$ReservationNode)
* the third if (line 1670) as well because fh = -3 (RESERVED)
* we fall back into the else block at line 1672
* tabAt(tab, i) == f is true (i=8) at line 1675
* the if at line 1676 is not satisfied because fh = -3
* the if at line 1696 is also not satisfied because f is an CHM$ReservationNode
* binCount = 0 so the if at line 1710 is also not satisfied.
Aaaand back to the beginning of the loop at 1649.
The searched value is not yet present when computeIfPresent is called -> the mapper function should be called but that never happens.
This only happens occasionally.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The mapping function is called and the computed value is added to the map and returned.
ACTUAL -
Endless loop.
REPRODUCIBILITY :
This bug can be reproduced occasionally.
- backported by
-
JDK-8142175 ConcurrentHashMap.computeIfAbsent stuck in an endless loop
- Resolved
- duplicates
-
JDK-8134853 Bulk integration of java.util.concurrent and related java.util classes
- Resolved
-
JDK-8074374 Recursive ConcurrentHashMap.computeIfAbsent() call never terminates. Bug or ?fea
- Closed
-
JDK-8190949 Infinite loop of ConcurrentHashMap in recursive scene
- Closed