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 45608] New: Race conditions on field countAllocated of class org.apache.catalina.core.StandardWrapper
Date Mon, 11 Aug 2008 04:27:39 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45608

           Summary: Race conditions on field countAllocated of class
                    org.apache.catalina.core.StandardWrapper
           Product: Tomcat 6
           Version: 6.0.13
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: qiyaoltc@gmail.com


We found field countAllocated are accessed by allocate() and deallocate()
without any protections by locks.

Here is a trace log,

  Thread http-8081-1 id: 23 : READ
      [org.apache.catalina.core.StandardWrapper : allocate : 820]
      [org.apache.catalina.core.StandardWrapperValve : invoke : 129]
      [org.apache.catalina.core.StandardContextValve : invoke : 175]
      [org.apache.catalina.core.StandardHostValve : invoke : 128]
      [org.apache.catalina.valves.ErrorReportValve : invoke : 104]
      [org.apache.catalina.core.StandardEngineValve : invoke : 109]
      [org.apache.catalina.connector.CoyoteAdapter : service : 261]
      [org.apache.coyote.http11.Http11Processor : process : 844]
      [org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler :
process : 581]
      [org.apache.tomcat.util.net.JIoEndpoint$Worker : run : 447]
      [java.lang.Thread : run : 735]

  Thread http-8081-4 id: 26 : WRITE

      [org.apache.catalina.core.StandardWrapper : deallocate : 871]
      [org.apache.catalina.core.StandardWrapperValve : invoke : 298]
      [org.apache.catalina.core.StandardContextValve : invoke : 175]
      [org.apache.catalina.core.StandardHostValve : invoke : 128] 
      [org.apache.catalina.valves.ErrorReportValve : invoke : 104] 
      [org.apache.catalina.core.StandardEngineValve : invoke : 109]
      [org.apache.catalina.connector.CoyoteAdapter : service : 261]
      [org.apache.coyote.http11.Http11Processor : process : 844]
      [org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler :
process : 581]
      [org.apache.tomcat.util.net.JIoEndpoint$Worker : run : 447]
      [java.lang.Thread : run : 735]

Thread http-8081-4 and http-8081-1 will access countAllocated in parallel. 
Since increment and decrement is *NOT* atomic, we think it is a potential race
condition.


-- 
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