Bug 58383 - Data race inside non-thread-safe HashMap org.apache.catalina.tribes.transport.SenderState.memberStates
Data race inside non-thread-safe HashMap org.apache.catalina.tribes.transport...
Status: RESOLVED FIXED
Product: Tomcat 8
Classification: Unclassified
Component: Catalina
8.0.x-trunk
PC Linux
: P2 normal (vote)
: ----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2015-09-12 16:04 UTC by Yilong Li
Modified: 2015-09-15 13:28 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yilong Li 2015-09-12 16:04:47 UTC
Reported by RV-Predict (a dynamic race detector) when running the test suite:
Data race on field java.util.HashMap.$state: {{{
    Concurrent read in thread T48 (locks held: {})
 ---->  at org.apache.catalina.tribes.transport.SenderState.getSenderState(SenderState.java:45)
        at org.apache.catalina.tribes.transport.SenderState.getSenderState(SenderState.java:41)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberAdded(ChannelCoordinator.java:244)
        at org.apache.catalina.tribes.membership.McastService.memberAdded(McastService.java:461)
        at org.apache.catalina.tribes.membership.McastServiceImpl$2.run(McastServiceImpl.java:397)
    T48 is created by T38
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)

    Concurrent write in thread T57 (locks held: {Monitor@552f7995})
 ---->  at org.apache.catalina.tribes.transport.SenderState.getSenderState(SenderState.java:51)
        - locked Monitor@552f7995 at org.apache.catalina.tribes.transport.SenderState.getSenderState(SenderState.java:47)
        at org.apache.catalina.tribes.transport.SenderState.getSenderState(SenderState.java:41)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberAdded(ChannelCoordinator.java:244)
        at org.apache.catalina.tribes.membership.McastService.memberAdded(McastService.java:461)
        at org.apache.catalina.tribes.membership.McastServiceImpl$2.run(McastServiceImpl.java:397)
    T57 is created by T40
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}} 

Data race on field java.util.HashMap.$state: {{{
    Concurrent read in thread T189 (locks held: {})
 ---->  at org.apache.catalina.tribes.transport.SenderState.getSenderState(SenderState.java:45)
        at org.apache.catalina.tribes.transport.SenderState.getSenderState(SenderState.java:41)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberAdded(ChannelCoordinator.java:244)
        at org.apache.catalina.tribes.membership.McastService.memberAdded(McastService.java:461)
        at org.apache.catalina.tribes.membership.McastServiceImpl$2.run(McastServiceImpl.java:397)
    T189 is created by T185
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)

    Concurrent write in thread T188 (locks held: {Monitor@552f7995})
 ---->  at org.apache.catalina.tribes.transport.SenderState.removeSenderState(SenderState.java:60)
        - locked Monitor@552f7995 at org.apache.catalina.tribes.transport.SenderState.removeSenderState(SenderState.java:59)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberDisappeared(ChannelCoordinator.java:250)
        at org.apache.catalina.tribes.membership.McastService.memberDisappeared(McastService.java:471)
        at org.apache.catalina.tribes.membership.McastServiceImpl$4.run(McastServiceImpl.java:467)
    T188 is created by T168
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}}
Comment 1 Mark Thomas 2015-09-15 13:28:36 UTC
Fixed in trunk and 8.0.x for 8.0.27 onwards.