Bug 58373

Summary: Data race on field org.apache.catalina.core.StandardContext.applicationEventListenersObjects
Product: Tomcat 8 Reporter: Yilong Li <yilong.li>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: Linux   

Description Yilong Li 2015-09-12 01:30:39 UTC
Reported by RV-Predict (a dynamic race detector) when running the test suite:
Data race on field org.apache.catalina.core.StandardContext.applicationEventListenersObjects: {{{
    Concurrent read in thread T204 (locks held: {Monitor@424a8381})
 ---->  at org.apache.catalina.core.StandardContext.getApplicationEventListeners(StandardContext.java:1155)
        at org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(StandardContext.java:5920)
        at org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:282)
        at org.apache.coyote.http11.AbstractHttp11Processor.asyncDispatch(AbstractHttp11Processor.java:1709)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:651)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:277)
        - locked Monitor@424a8381 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:259) 
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T204 is created by T202
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)

    Concurrent write in thread T200 (locks held: {Monitor@42766493})
 ---->  at org.apache.catalina.core.StandardContext.setApplicationEventListeners(StandardContext.java:1161)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4825)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        - locked Monitor@42766493 at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:n/a) 
        at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424)
    T200 is created by T199
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}}
Comment 1 Mark Thomas 2015-09-14 18:32:51 UTC
Fixed in trunk and 8.0.x for 8.0.27 onwards.