Bug 45666

Summary: JspContextWrapper contains infinite loop in include(String relativeUrlPath, boolean flush)
Product: Tomcat 5 Reporter: Tom Wadzinski <mybulkmail1212>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 5.5.26   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Demonstrates issue #45666

Description Tom Wadzinski 2008-08-21 06:47:17 UTC
public void include(String relativeUrlPath, boolean flush)
			throws ServletException, IOException {
		include(relativeUrlPath, false); // XXX
	}

just calls itself it seems. Perhaps this should be (just a guess):

public void include(String relativeUrlPath, boolean flush)
			throws ServletException, IOException {
		invokingJspCtxt.include(relativeUrlPath, false); // XXX
	}

This came up for me when I had a .tag file that had an include in it. 

I was using Tomcat 5.5 but looking at the source of JspContextWrapper.java it looks like this issue is in 5.5 as well as 6 (and the svn trunk).
Comment 1 Mark Thomas 2008-08-31 10:28:07 UTC
I have tried to repeat this with 5.5.x and 6.0.x but have not had any luck. I've also reviewed the code to see if I could find where the method is called but couldn't find anywhere. Could you provide a simple test war that demonstrates the issue?
Comment 2 Konstantin Kolinko 2008-08-31 13:33:59 UTC
Created attachment 22504 [details]
Demonstrates issue #45666

See /WEB-INF/tags/tag.tag

To demonstrate the issue, access the /index.jsp page.

Expected result:
A page with "Hello world!" message.

Actual result (in tc6.0):
"HTTP Status 500" error page - java.lang.StackOverflowError

Replacing "include("/include.html", false);" call in tag.tag with include("/include.html"); displays the "Hello world!" message as expected.
Comment 3 Mark Thomas 2008-08-31 14:09:13 UTC
Many thanks for the test case - it makes fixing bugs so much quicker.

This has been fixed in trunk and proposed for 6.0.x and 5.5.x.
Comment 4 Mark Thomas 2008-09-06 13:13:16 UTC
The patch has been applied to 6.0.x and will be included in 6.0.19 onwards.
Comment 5 David Mansfield 2009-01-20 13:26:36 UTC
any chance to get this into the 5.5 line?  it's really quite a bogus bug with an obvious fix.
Comment 6 Mark Thomas 2009-03-22 10:08:57 UTC
This has been fixed in 5.5.x and will be included in 5.5.28 onwards.