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 50138] New: Lack of synchronization in org.apache.catalina.security.SecurityUtil
Date Thu, 21 Oct 2010 13:23:01 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50138

           Summary: Lack of synchronization in
                    org.apache.catalina.security.SecurityUtil
           Product: Tomcat 6
           Version: 6.0.29
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: mikhailov.dmitry@gmail.com


Symptom: all processor threads spin madly in:
==============
"tomcat-processor-20" daemon prio=10 tid=0x09210800 nid=0x51fb runnable
[0x61b76000]
   java.lang.Thread.State: RUNNABLE
    at java.util.HashMap.getEntry(HashMap.java:347)
    at java.util.HashMap.containsKey(HashMap.java:335)
    at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:227)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
    at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
    at java.security.AccessController.doPrivileged(Native Method)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
...
==============

Cause: org.apache.catalina.security.SecurityUtil.objectCache is a HashMap, but
access to it is not synchronized. The javadoc for HashMap says:
=============
Note that this implementation is not synchronized. If multiple threads access a
hash map concurrently, and at least one of the threads modifies the map
structurally, it must be synchronized externally.
=============

Proposed solution: change objectCache to ConcurrentHashMap;

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