Bug 36343 - StackOverFlowError/OutOfMemory caused by folder name "\"
Summary: StackOverFlowError/OutOfMemory caused by folder name "\"
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Unknown (show other bugs)
Version: 5.5.9
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-24 20:11 UTC by James Rigg
Modified: 2005-08-28 19:10 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Rigg 2005-08-24 20:11:43 UTC
In brief:
Tomcat 5.0.28 and 5.5.9 (Linux) throwing StackOverFlowError/OutofMemory when
doing page translation of a JSP using a tag library, if the folder containing an
included JSP contains a folder with name "\".

Steps to reproduce
(based on what I am doing - this problem is reproducable in other scenarios I am
sure):

/WEB-INF/classes/ contains:
oscache.properties
oscache.tld
(the OpenSymphony files for OsCache)

/WEB-INF/web.xml contains the lines:
<taglib>
  <taglib-uri>oscache</taglib-uri>
  <taglib-location>/WEB-INF/classes/oscache.tld</taglib-location>
</taglib>

/index.jsp contains the lines:
<%@ taglib uri="oscache" prefix="cache" %>
<%@ include file="/WEB-INF/templates/includes/page_layout/debugstart.jsp" %>

The folder /WEB-INF/templates/includes/ contains a folder with name "\" (by
accident in my case)


Start Tomcat, hit /index.jsp and watch Tomcat panic until it eventually runs out
of memory or heap.



Stack trace:
Aug 24, 2005 1:26:42 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.StackOverflowError
        at sun.nio.cs.UTF_8$Decoder.decodeArrayLoop(UTF_8.java:270)
        at sun.nio.cs.UTF_8$Decoder.decodeLoop(UTF_8.java:416)
        at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:542)
        at java.lang.StringCoding$CharsetSD.decode(StringCoding.java:184)
        at java.lang.StringCoding.decode(StringCoding.java:222)
        at java.lang.String.<init>(String.java:405)
        at java.lang.String.<init>(String.java:433)
        at java.io.UnixFileSystem.list(Native Method)
        at java.io.File.list(File.java:937)
        at org.apache.naming.resources.FileDirContext.list(FileDirContext.java:885)
        at
org.apache.naming.resources.FileDirContext.listBindings(FileDirContext.java:335)
        at
org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:515)
        at
org.apache.catalina.core.ApplicationContext.listCollectionPaths(ApplicationContext.java:953)
        at
org.apache.catalina.core.ApplicationContext.getResourcePathsInternal(ApplicationContext.java:573)
        at
org.apache.catalina.core.ApplicationContext.getResourcePaths(ApplicationContext.java:556)
        at
org.apache.catalina.core.ApplicationContextFacade.getResourcePaths(ApplicationContextFacade.java:160)
        at
org.apache.jasper.compiler.TldLocationsCache.processTldsInFileSystem(TldLocationsCache.java:419)
        at
org.apache.jasper.compiler.TldLocationsCache.processTldsInFileSystem(TldLocationsCache.java:425)
        at
org.apache.jasper.compiler.TldLocationsCache.processTldsInFileSystem(TldLocationsCache.java:425)
        at
org.apache.jasper.compiler.TldLocationsCache.processTldsInFileSystem(TldLocationsCache.java:425)
[snip - hundreds of instances of TldLocationsCache.java]
Comment 1 william.barker 2005-08-29 03:10:07 UTC
This is fixed in the CVS, and will appear in TC 5.5.12.