You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/12/18 23:51:20 UTC

DO NOT REPLY [Bug 52353] New: Possibility of unsynchronized concurrent access to field "org.apache.catalina.tribes.group.ChannelInterceptorBase.next"

https://issues.apache.org/bugzilla/show_bug.cgi?id=52353

             Bug #: 52353
           Summary: Possibility of unsynchronized concurrent access to
                    field
                    "org.apache.catalina.tribes.group.ChannelInterceptorBa
                    se.next"
           Product: Tomcat 7
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: reprogrammer@gmail.com
    Classification: Unclassified


Method "org.apache.catalina.tribes.group.ChannelInterceptorBase.getNext()" is
reachable from method
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.run(),
which implements the run method of a "Runnable" class. The following is a
sequence of method calls from "MessageDispatchInterceptor.run()" to
"ChannelInterceptorBase.getNext()":

1.
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.run()
2.
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.sendAsyncData(LinkObject)
3.
org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(Member[],
ChannelMessage, InterceptorPayload)
4. org.apache.catalina.tribes.group.ChannelInterceptorBase.getNext()

Similarly,
"org.apache.catalina.tribes.group.ChannelInterceptorBase.setNext(ChannelInterceptor)"
may be called from
"org.apache.catalina.tribes.demos.CoordinationDemo.cmdStart(...).new Thread()
{...}.run()", which implements the "run" method of a "Thread". The following is
a sequence of method calls that shows the possibility of invoking
"ChannelInterceptorBase.setNext(ChannelInterceptor)" from a "Thread":

1. org.apache.catalina.tribes.demos.CoordinationDemo.cmdStart(...).new Thread()
{...}.run()
2. org.apache.catalina.tribes.demos.CoordinationDemo.Status.start()
3. org.apache.catalina.tribes.demos.CoordinationDemo.Status.createChannel()
4.
org.apache.catalina.tribes.group.GroupChannel.addInterceptor(ChannelInterceptor)
5.
org.apache.catalina.tribes.group.ChannelInterceptorBase.setNext(ChannelInterceptor)

Since field "org.apache.catalina.tribes.group.ChannelInterceptorBase.next" may
get accessed concurrently, it should get properly synchronized.

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


DO NOT REPLY [Bug 52353] Possibility of unsynchronized concurrent access to field "org.apache.catalina.tribes.group.ChannelInterceptorBase.next"

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52353

Mohsen Vakilian <re...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reprogrammer@gmail.com

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


DO NOT REPLY [Bug 52353] Possibility of unsynchronized concurrent access to field "org.apache.catalina.tribes.group.ChannelInterceptorBase.next"

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52353

--- Comment #2 from Mohsen Vakilian <re...@gmail.com> 2011-12-24 00:21:24 UTC ---
Thanks for reviewing this issue. Keshmesh <http://keshmesh.cs.illinois.edu/>
detected this problem when we marked method
"org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.run()"
as an entry point and ran Keshmesh on Tomcat.

Keshmesh considers the method "Runnable.run()" as an indicator of possible
concurrency. Of course, "Runnable.run()" may not be ever used in a concurrent
context, as seems to be the case here.

It's good to know that interceptors are not supposed to be configured on the
fly. We'd be happy to run Keshmesh on other concurrent parts of Tomcat.
Keshmesh analyzes the code that is reachable from the methods that we mark as
entry points. Given your deep knowledge of the Tomcat code base, you know
better which part of Tomcat is more likely to benefit from Keshmesh. Do you
know of other concurrent parts of Tomcat that might benefit from Keshmesh
analyses more?

By the way, if you use Eclipse, you can try out Keshmesh yourself. We'd love to
hear your feedback on it.

(In reply to comment #1)
> Also, interceptors (and the cluster generally) are not intended to be
> configured on the fly. If they were, there is a heap of concurrency issues that
> would need to be fixed. Note: on the fly addition and removal of cluster
> members is handled.

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


DO NOT REPLY [Bug 52353] Possibility of unsynchronized concurrent access to field "org.apache.catalina.tribes.group.ChannelInterceptorBase.next"

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52353

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Mark Thomas <ma...@apache.org> 2011-12-23 20:57:31 UTC ---
The second call path quoted is test code that isn't shipped in a Tomcat release
build.

Also, interceptors (and the cluster generally) are not intended to be
configured on the fly. If they were, there is a heap of concurrency issues that
would need to be fixed. Note: on the fly addition and removal of cluster
members is handled.

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