Bug 58369 - Data race on field org.apache.catalina.core.StandardContext.cookieProcessor
Summary: Data race on field org.apache.catalina.core.StandardContext.cookieProcessor
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-12 01:04 UTC by Yilong Li
Modified: 2015-09-14 09:34 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 01:04:53 UTC
Reported by RV-Predict (a dynamic race detector) when running the test suite:
Data race on field org.apache.catalina.core.StandardContext.cookieProcessor: {{{
    Concurrent write in thread T27 (locks held: {Monitor@3bb9edae})
 ---->  at org.apache.catalina.core.StandardContext.getCookieProcessor(StandardContext.java:828)
        at org.apache.catalina.connector.Request.parseCookies(Request.java:2957)
        at org.apache.catalina.connector.Request.getServerCookies(Request.java:2006)
        at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1205)
        at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:916)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:513)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:277)
        - locked Monitor@3bb9edae at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:259) 
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T27 is created by T15
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)

    Concurrent write in thread T28 (locks held: {Monitor@6d627e28})
 ---->  at org.apache.catalina.core.StandardContext.getCookieProcessor(StandardContext.java:828)
        at org.apache.catalina.connector.Request.parseCookies(Request.java:2957)
        at org.apache.catalina.connector.Request.getServerCookies(Request.java:2006)
        at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1205)
        at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:916)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:513)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:277)
        - locked Monitor@6d627e28 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:259) 
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T28 is created by T15
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}}

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