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 2010/12/12 01:06:19 UTC

DO NOT REPLY [Bug 50459] New: StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

           Summary: StandardContext.bindThread() and unbindThread() are
                    not symmetrical and not limited to current thread
           Product: Tomcat 7
           Version: 7.0.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: sylvain.laurent@gmail.com


As a side effect of my commit, I think I found a bug in
StandardContext.bindThread() and unbindThread() methods in both tomcat 6 and 7
:

- the methods should be symmetrical : unbindThread should restore the Thread
CCL after calling DirContextURLStreamHandler.unbind() and
ContextBindings.unbindThread()
- StandardContext.bindThread() should call
DirContextURLStreamHandler.bindThread() instead of
DirContextURLStreamHandler.bind()
- StandardContext.unbindThread() should call
DirContextURLStreamHandler.unbindThread() instead of
DirContextURLStreamHandler.unbind()

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

--- Comment #1 from Sylvain Laurent <sy...@gmail.com> 2010-12-11 19:09:33 EST ---
oops, forgot the link to my initial commit that revealed the bug :
http://svn.apache.org/viewvc?rev=1044145&view=rev

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

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

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

--- Comment #8 from Mark Thomas <ma...@apache.org> 2011-01-05 09:18:11 EST ---
Fixed in 6.0.x and will be included in 6.0.30 onwards.

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

--- Comment #4 from Sylvain Laurent <sy...@gmail.com> 2010-12-12 17:56:31 EST ---
patch proposed for tomcat 6

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

--- Comment #6 from Sylvain Laurent <sy...@gmail.com> 2010-12-13 17:42:40 EST ---
Actually the TCCL is properly bound in DirContextURLStreamHandler#clBindings
when the application is started : DirContextURLStreamHandler.bind(ClassLoader,
DirContext) is called from WebappLoader.startInternal() which itself is called
during StandardContext.startInternal() (StandardContext.java rev 1044747 line
4863)

Before my fix, it was "pure luck" that the TCCL was still bound after
StandardContext.startInternal() : it only worked because the TCCL was reverted
_after_ calling DirContextURLStreamHandler.unbind() so that the latter tried to
remove a classloader that had not been bound previously, thus leaving the
webapp classloader properly bound.

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Catalina                    |Catalina
            Version|7.0.5                       |6.0.29
            Product|Tomcat 7                    |Tomcat 6
   Target Milestone|---                         |default

--- Comment #3 from Mark Thomas <ma...@apache.org> 2010-12-12 16:22:28 EST ---
Moving to 6 now it is fixed in 7.

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

--- Comment #2 from Sylvain Laurent <sy...@gmail.com> 2010-12-11 19:12:12 EST ---
fix committed on trunk : http://svn.apache.org/viewvc?rev=1044746&view=rev

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

--- Comment #5 from Konstantin Kolinko <kn...@gmail.com> 2010-12-12 18:43:04 EST ---
Looking at r1044746 and the patch proposed for TC6,
I think that that replacement of
 s/DirContextURLStreamHandler.bind(/DirContextURLStreamHandler.bindThread(/
 s/DirContextURLStreamHandler.unbind(/DirContextURLStreamHandler.unbindThread(/
is wrong.

See DirContextURLStreamHandler#get().

The difference is when a web application starts a child thread. That thread
inherits TCCL from its parent and thus DirContextURLStreamHandler will
recognize it when using CL-binding, but will not if thread-binding is used.

-- 
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 50459] StandardContext.bindThread() and unbindThread() are not symmetrical and not limited to current thread

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

--- Comment #7 from Konstantin Kolinko <kn...@gmail.com> 2010-12-19 19:48:15 EST ---
(In reply to comment #6)
OK, I understand it now. WebappLoader indeed manages that binding.

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