Bug 58392 - Data race on field org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.membership
Data race on field org.apache.catalina.tribes.group.interceptors.DomainFilter...
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:50 UTC by Yilong Li
Modified: 2015-09-17 09:29 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:50:39 UTC
Reported by RV-Predict (a dynamic race detector) when running the test suite:
Data race on field org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.membership: {{{
    Concurrent read in thread T49 (locks held: {})
 ---->  at org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.memberAdded(DomainFilterInterceptor.java:58)
        at org.apache.catalina.tribes.group.ChannelInterceptorBase.memberAdded(ChannelInterceptorBase.java:87)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberAdded(ChannelCoordinator.java:245)
        at org.apache.catalina.tribes.membership.McastService.memberAdded(McastService.java:461)
        at org.apache.catalina.tribes.membership.McastServiceImpl$2.run(McastServiceImpl.java:397)
    T49 is created by T35
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)

    Concurrent write in thread T48 (locks held: {Monitor@58bf36a2})
 ---->  at org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.setupMembership(DomainFilterInterceptor.java:108)
        - locked Monitor@58bf36a2 at org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.setupMembership(DomainFilterInterceptor.java:n/a)
        at org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.memberAdded(DomainFilterInterceptor.java:58)
        at org.apache.catalina.tribes.group.ChannelInterceptorBase.memberAdded(ChannelInterceptorBase.java:87)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberAdded(ChannelCoordinator.java:245)
        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 T35
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}} 

Data race on field org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.membership: {{{
    Concurrent read in thread T49 (locks held: {})
 ---->  at org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.memberAdded(DomainFilterInterceptor.java:60)
        at org.apache.catalina.tribes.group.ChannelInterceptorBase.memberAdded(ChannelInterceptorBase.java:87)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberAdded(ChannelCoordinator.java:245)
        at org.apache.catalina.tribes.membership.McastService.memberAdded(McastService.java:461)
        at org.apache.catalina.tribes.membership.McastServiceImpl$2.run(McastServiceImpl.java:397)
    T49 is created by T35
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)

    Concurrent write in thread T48 (locks held: {Monitor@58bf36a2})
 ---->  at org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.setupMembership(DomainFilterInterceptor.java:108)
        - locked Monitor@58bf36a2 at org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.setupMembership(DomainFilterInterceptor.java:n/a)
        at org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor.memberAdded(DomainFilterInterceptor.java:58)
        at org.apache.catalina.tribes.group.ChannelInterceptorBase.memberAdded(ChannelInterceptorBase.java:87)
        at org.apache.catalina.tribes.group.ChannelCoordinator.memberAdded(ChannelCoordinator.java:245)
        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 T35
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}}

Non-thread-safe implementation of lazy initialization.
Comment 1 Mark Thomas 2015-09-17 09:29:16 UTC
Fixed in trunk and 8.0.x for 8.0.27 onwards.