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 39088] - StandardWrapper getRootCause() infinite loop
Date Mon, 17 Apr 2006 15:47:40 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39088>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39088


jleech@virtela.net changed:

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




------- Additional Comments From jleech@virtela.net  2006-04-17 15:47 -------
(In reply to comment #3)
> The problem is user code:
> return cause == null ? this : cause;
> 
> If the root cause is null, then it should return null, not itself. 

You can't control every exception class that could be thrown in user code.  This
is getRootCause(), not getCause().  Lots of java code was written before Sun
added getCause() to Throwable and standardized exception chaining.

Tomcat calling getRootCause() of an arbitrary exception class is dangerous, as
the infinite loop demonstrates.  It should either only call it on descendants of
ServletException and a few other known types, or at a minimum protect against
the infinite loop condition.


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

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


Mime
View raw message