tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49986] Double-check locking. Possible data-race in JspServletWrapper
Date Thu, 23 Sep 2010 14:29:41 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49986

--- Comment #2 from Sergey Vorobyev <sergeyvorobyev@google.com> 2010-09-23 10:29:38
EDT ---
(In reply to comment #1)
> Looks like a problem to me if the class can be called from multiple threads.
> If not, then why have any synch. blocks at all?

It's called from multiple threads.
Stack trace:
    Thread 28
    #0  org/apache/jasper/servlet/JspServletWrapper.getServlet
JspServletWrapper.java:166
    #1  org/apache/jasper/servlet/JspServletWrapper.service
JspServletWrapper.java:329
    #2  org/apache/jasper/servlet/JspServlet.serviceJspFile JspServlet.java:313
    #3  org/apache/jasper/servlet/JspServlet.service JspServlet.java:260
    #4  javax/servlet/http/HttpServlet.service HttpServlet.java:717
    #5  org/apache/catalina/core/ApplicationFilterChain.internalDoFilter
ApplicationFilterChain.java:290
    #6  org/apache/catalina/core/ApplicationFilterChain.doFilter
ApplicationFilterChain.java:206
    #7  org/apache/catalina/core/StandardWrapperValve.invoke
StandardWrapperValve.java:233
    #8  org/apache/catalina/core/StandardContextValve.invoke
StandardContextValve.java:191
    #9  org/apache/catalina/authenticator/AuthenticatorBase.invoke
AuthenticatorBase.java:470
    #10 org/apache/catalina/core/StandardHostValve.invoke
StandardHostValve.java:127
    #11 org/apache/catalina/valves/ErrorReportValve.invoke
ErrorReportValve.java:102

   Thread 25
    #0  org/apache/jasper/servlet/JspServletWrapper.getServlet
JspServletWrapper.java:133
    #1  org/apache/jasper/servlet/JspServletWrapper.service
JspServletWrapper.java:329
    #2  org/apache/jasper/servlet/JspServlet.serviceJspFile JspServlet.java:313
    #3  org/apache/jasper/servlet/JspServlet.service JspServlet.java:260
    #4  javax/servlet/http/HttpServlet.service HttpServlet.java:717
    #5  org/apache/catalina/core/ApplicationFilterChain.internalDoFilter
ApplicationFilterChain.java:290
    #6  org/apache/catalina/core/ApplicationFilterChain.doFilter
ApplicationFilterChain.java:206
    #7  org/apache/catalina/core/StandardWrapperValve.invoke
StandardWrapperValve.java:233
    #8  org/apache/catalina/core/StandardContextValve.invoke
StandardContextValve.java:191
    #9  org/apache/catalina/authenticator/AuthenticatorBase.invoke
AuthenticatorBase.java:470

> The servletClassLastModifiedTime also looks to be used in a similar way; that
> is a long so could potentially an invalid value could be read.

Exactly! Thank you for point    

     public void setServletClassLastModifiedTime(long lastModified) {
        if (this.servletClassLastModifiedTime < lastModified) {
            synchronized (this) {
                if (this.servletClassLastModifiedTime < lastModified) {
                    this.servletClassLastModifiedTime = lastModified;
                    reload = true;
                }
            }
        }
    }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message