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 2006/01/25 05:37:06 UTC

DO NOT REPLY [Bug 38376] New: - Body content stack may not be properly maintained in the faces of exceptions

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=38376>.
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=38376

           Summary: Body content stack may not be properly maintained in the
                    faces of exceptions
           Product: Tomcat 5
           Version: 5.5.14
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: apache@deigh.com


The code that increments _jspx_push_body_count_XXX[0], which is the count of the
number of outstanding calls to _jspx_page_context.pushBody() within a try block,
is properly within the conditional that is true only if doStartTag() returns
EVAL_BODY_INCLUDE. The corresponding code that decrements the same variable,
however, is not within the corresponding conditional, although the call to
_jspx_page_context.popBody() is. The outstanding count may therefore be wrong,
and the code that pops these extra BodyContents in the finally block pops too
few. In the following Jasper-generated code snippet, note that
_jspx_push_body_count_rwc_dbTry_0[0]++ on the third line is conditional, but
_jspx_push_body_count_rwc_dbTry_0[0]-- on the last line is not.

Jasper-generated code snippet:

if (_jspx_eval_rwc_formPhase_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_push_body_count_rwc_dbTry_0[0]++;
_jspx_th_rwc_formPhase_0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_rwc_formPhase_0.doInitBody();
}
do {
...

int evalDoAfterBody = _jspx_th_rwc_formPhase_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_rwc_formPhase_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
out = _jspx_page_context.popBody();
_jspx_push_body_count_rwc_dbTry_0[0]--;  // THIS SHOULD BE IN THE IF BLOCK!

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


DO NOT REPLY [Bug 38376] - Body content stack may not be properly maintained in the faces of exceptions

Posted by bu...@apache.org.
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=38376>.
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=38376


yoavs@computer.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From yoavs@computer.org  2006-04-13 20:15 -------
Seems like a good catch.  When I go to implement it, I see Generator.java has
changed since you reported this, and now the line numbers in your patch don't
match.  There are two possible matching sections in the file, one of which seems
to have a proper } closure, the other doesn't, but that second one has what
would become an extra closure outside the if clause.  If you get a chance,
please take a look at the current SVN HEAD version and submit an updated patch.
 Thanks!

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


DO NOT REPLY [Bug 38376] - Body content stack may not be properly maintained in the faces of exceptions

Posted by bu...@apache.org.
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=38376>.
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=38376


apache@deigh.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #17500|0                           |1
        is obsolete|                            |




------- Additional Comments From apache@deigh.com  2006-04-13 20:49 -------
Created an attachment (id=18096)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18096&action=view)
Change to Generator.java for 5.5.x HEAD

Updated for SVN HEAD as of today.

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


DO NOT REPLY [Bug 38376] - Body content stack may not be properly maintained in the faces of exceptions

Posted by bu...@apache.org.
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=38376>.
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=38376





------- Additional Comments From apache@deigh.com  2006-04-13 20:45 -------
(From update of attachment 17500)
--- Generator.java.orig 2006-04-13 16:24:25.164043200 -0400
+++ Generator.java	2006-04-13 16:26:05.808763200 -0400
@@ -2278,7 +2278,7 @@
		     out.printin("if (");
		     out.print(tagEvalVar);
		     out.println(
-			 " !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)");
+			 " != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
{");
		     out.pushIndent();
		     out.printil("out = _jspx_page_context.popBody();");
		     if (n.implementsTryCatchFinally()) {
@@ -2289,6 +2289,7 @@
			 out.println("[0]--;");
		     }
		     out.popIndent();
+		     out.printil("}");
		 }

		 out.popIndent(); // EVAL_BODY


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


DO NOT REPLY [Bug 38376] - Body content stack may not be properly maintained in the faces of exceptions

Posted by bu...@apache.org.
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=38376>.
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=38376


apache@deigh.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #17500|Change to Generator.java    |Change to Generator.java for
        description|                            |5.5.x HEAD.




------- Additional Comments From apache@deigh.com  2006-04-13 20:43 -------
(From update of attachment 17500)
--- Generator.java.orig 2006-04-13 16:24:25.164043200 -0400
+++ Generator.java	2006-04-13 16:26:05.808763200 -0400
@@ -2278,7 +2278,7 @@
		     out.printin("if (");
		     out.print(tagEvalVar);
		     out.println(
-			 " !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)");
+			 " != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
{");
		     out.pushIndent();
		     out.printil("out = _jspx_page_context.popBody();");
		     if (n.implementsTryCatchFinally()) {
@@ -2289,6 +2289,7 @@
			 out.println("[0]--;");
		     }
		     out.popIndent();
+		     out.printil("}");
		 }

		 out.popIndent(); // EVAL_BODY


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


DO NOT REPLY [Bug 38376] - Body content stack may not be properly maintained in the faces of exceptions

Posted by bu...@apache.org.
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=38376>.
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=38376


yoavs@computer.org changed:

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




------- Additional Comments From yoavs@computer.org  2006-04-13 20:56 -------
OK, thank you, patch applied.

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


DO NOT REPLY [Bug 38376] - Body content stack may not be properly maintained in the faces of exceptions

Posted by bu...@apache.org.
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=38376>.
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=38376





------- Additional Comments From apache@deigh.com  2006-01-25 05:50 -------
Created an attachment (id=17500)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17500&action=view)
Change to Generator.java


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


DO NOT REPLY [Bug 38376] - Body content stack may not be properly maintained in the faces of exceptions

Posted by bu...@apache.org.
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=38376>.
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=38376


apache@deigh.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #17500|Change to Generator.java for|Change to Generator.java.
        description|5.5.x HEAD.                 |




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