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 16:02:42 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





------- Additional Comments From funkman@joedog.org  2006-04-17 16:02 -------
At best - here is the patch if any (not me) is interested ...
/container/catalina/src/share/org/apache/catalina/core/StandardWrapper.java

@@ -627,13 +627,14 @@
 
     /**
      * Extract the root cause from a servlet exception.
-     * 
+     *
      * @param e The servlet exception
      */
     public static Throwable getRootCause(ServletException e) {
         Throwable rootCause = e;
         Throwable rootCauseCheck = null;
         // Extra aggressive rootCause finding
+        int recursionKlugeDetector = 20;
         do {
             try {
                 rootCauseCheck = (Throwable)IntrospectionUtils.getProperty
@@ -644,6 +645,16 @@
             } catch (ClassCastException ex) {
                 rootCauseCheck = null;
             }
+
+            /*
+                We've done this 20 times .. if you've nested more than
+                20 levels of exceptions. Tomcat throwing the wrong exception
+                is the least of your concerns.
+            */
+
+            if (recursionKlugeDetector-- == 0) {
+                return rootCause;
+            }
         } while (rootCauseCheck != null);
         return rootCause;
     }


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