You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/07/13 00:27:22 UTC

DO NOT REPLY [Bug 10764] New: - stackOverflow with maxOccurs over 5000 and less than unbounded

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10764>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10764

stackOverflow with maxOccurs over 5000 and less than unbounded

           Summary: stackOverflow with maxOccurs over 5000 and less than
                    unbounded
           Product: Xerces2-J
           Version: 2.0.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Other
         Component: DOM
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: afuqua@iss.net


On Windows XP and NT and 2000, when validating a document with the schema 
below, I get a stackOverflow. I've seen the overflow report in 2 different 
locations for different schemas:

java.lang.StackOverflowError
	at org.apache.xerces.impl.xs.models.XSDFACM.postTreeBuildInit
(XSDFACM.java:899)
	....

java.lang.StackOverflowError
	at org.apache.xerces.impl.xs.models.XSDFACM.calcFollowList
(XSDFACM.java:732)
	....


Here's an example schema to reproduce the problem:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
		targetNamespace="http://www.iss.net/cpe/stackOverflow"
		xmlns:stackOverflow="http://www.iss.net/cpe/stackOverflow"
		elementFormDefault="qualified"
		attributeFormDefault="unqualified">
	
	<element name="policy" type="stackOverflow:PolicyType"/>

	<complexType name="PolicyType">
		<sequence>
			<!-- fails for me as low as 5000 and up -->
			<element name='sensitivity' 
type='stackOverflow:sensitivityType' minOccurs='0' maxOccurs='65535'/>
		</sequence>
	</complexType>
	
	<complexType name="sensitivityType">
		<attribute name="sensitivity" type="int" use="required"/>
	</complexType>
</schema>


Here's a code excerpt:
DOMParser domParser = new DOMParser();
domParser.setErrorHandler( errorHandler );
domParser.setFeature( "http://xml.org/sax/features/namespaces", true );
domParser.setFeature( "http://apache.org/xml/features/validation/schema", 
true );
domParser.setFeature( "http://xml.org/sax/features/validation", true );
domParser.setProperty( "http://apache.org/xml/properties/schema/external-
schemaLocation", ....);
domParser.parse( new InputSource( new StringReader( .... )) );

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